Skip to content

Fix installation paths.#32

Closed
jgoppert wants to merge 1 commit intoqualisys:masterfrom
jgoppert:install_fix
Closed

Fix installation paths.#32
jgoppert wants to merge 1 commit intoqualisys:masterfrom
jgoppert:install_fix

Conversation

@jgoppert
Copy link
Copy Markdown

GNUInstallDirs was not defined when target_include_directories was set. This caused it to be blank and the cmake target import failed. User projects importing the cmake target should use include qualisys_cpp_sdk/RTProtocol.h etc.

@gorghino
Copy link
Copy Markdown

I confirm this is required on your Nvidia jetson platforms.
@Capelliexp

@MaximilienNaveau
Copy link
Copy Markdown

I did this PR before I saw your @jgoppert .
I believe this simple change fix your issue as well:
#45

RTProtocol.cpp Outdated
else
{
sprintf(maErrorStr, "No packet received. %s.", maErrorStr);
snprintf(maErrorStr, 1060, "No packet received. %s.", maErrorStr);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be part of the PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using snprintf(maErrorStr, 1060, "No packet received. %s.", maErrorStr); to avoid the compiler warning and potentially preventing buffer overflows seems reasonable. 👍 Although I suppose it could be a separate PR.

Maybe it's obvious, but where did a size of 1060 come from?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should be s separate PR. Also curious where 1060 comes from, as maErrorStr is 1024 characters.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting it to 1024 would be fine.

@OliverGlandberger
Copy link
Copy Markdown
Contributor

OliverGlandberger commented Nov 7, 2024

Like @MaximilienNaveau pointed out, his approach in #45 also addresses this issue by hardcoding include as the install path. However, I think using include(GNUInstallDirs) to set CMAKE_INSTALL_INCLUDEDIR provides more flexibility by allowing the path to adapt to system-specific conventions.

If there are any additional insights I should be aware of, please let me know. (:

@MaximilienNaveau
Copy link
Copy Markdown

Like @MaximilienNaveau pointed out, his approach in #45 also addresses this issue by hardcoding include as the install path. However, I think using include(GNUInstallDirs) to set CMAKE_INSTALL_INCLUDEDIR provides more flexibility by allowing the path to adapt to system-specific conventions.

If there are any additional insights I should be aware of, please let me know. (:

I believe this PR is better suited to be merge than mine I closed mine in response

Copy link
Copy Markdown
Contributor

@nim65s nim65s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the same in nim65s@c39f643, but forgot to open a PR, so thanks for this !

@nim65s
Copy link
Copy Markdown
Contributor

nim65s commented Nov 7, 2024

@jgoppert : could you consider adding nim65s@1ba8cdb to this PR ?
Otherwise I could make another one, but it is built on yours, so I guess it would be cleaner.

Copy link
Copy Markdown

@bahlborn bahlborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move sprintf->snprintf change to another PR.
Verify use of 1060 as buffer size.

@OliverGlandberger
Copy link
Copy Markdown
Contributor

Hey! I just wanted to mention that we've taken these changes from this fork of yours and create THIS PR. Feel free to have a look at it. Note that the "sprintf" issues have already been fixed.

Once the PR is approved and merged then we can close this one. Thank you very much for the input. :)

@jgoppert jgoppert force-pushed the install_fix branch 2 times, most recently from db5e226 to 02a6035 Compare February 19, 2025 18:53
GNUInstallDirs was not defined when target_include_directories
was set. This caused it to be blank and the cmake target import
failed. User projects importing the cmake target should use
include qualisys_cpp_sdk/RTProtocol.h etc.

Signed-off-by: James Goppert <james.goppert@gmail.com>
@jgoppert
Copy link
Copy Markdown
Author

I simplified this PR and just make the GNUInstallDirs fix.

@jgoppert
Copy link
Copy Markdown
Author

@OliverGlandberger @nim65s maybe we can make the other changes another PR and close this one for simplicity?

@jgoppert
Copy link
Copy Markdown
Author

jgoppert commented Feb 19, 2025

If it makes more sense to take it all together with #65 I'm fine with that. Just happy to see it merged :-)

@jgoppert jgoppert deleted the install_fix branch October 9, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants