Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RPATH + Use PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR consistently throughout #509

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

Chrismarsh
Copy link
Contributor

This fixes the CMakeLists.txt to consistently use PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR throughout instead of their SOURCE_* variants. Indeed, some PROJECT_* were already used -- this consistently applies it.

Doing so ensures WindNinja can be built in nested and out-of-source scenarios, such as with CPM.cmake.

In short, there are two predefined variables in CMake: CMAKE_SOURCE_DIR and PROJECT_SOURCE_DIR. CMAKE_SOURCE_DIR refers to the top-level source directory that contains a CMakeLists.txt, while PROJECT_SOURCE_DIR refers to the source directory of the most recent project() command

https://lesleylai.info/en/cmake_src_directory/

This also fixes the RPATH of the WindNinja_cli binary on Linux (i.e., when building with shared library) to correctly search for ../lib/ when installed.

… the CMakeLists.txt. This ensures compatibility with tools like CPM.cmake and nested/out of source builds
@nwagenbrenner nwagenbrenner self-assigned this Dec 13, 2023
@nwagenbrenner nwagenbrenner merged commit b768ecc into firelab:master Dec 13, 2023
@nwagenbrenner
Copy link
Member

@Chrismarsh Your changes look good to me. I just merged it. Thanks for submitting the PR.

@Chrismarsh
Copy link
Contributor Author

Thanks @nwagenbrenner. Would it be possible to also get this as a tagged release? Will make it easier for me to reference

@nwagenbrenner
Copy link
Member

nwagenbrenner commented Dec 21, 2023 via email

@Chrismarsh
Copy link
Contributor Author

Thanks, much appreciated.

@nwagenbrenner
Copy link
Member

Just tagged 3.10.0.0 for you.

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.

None yet

2 participants