Repository navigation
cmake: CMAKE_SOURCE_DIR -> PROJECT_SOURCE_DIR - #1121
Merged
Merged
Conversation
Fixes compiling as dependency with FetchContent
This comment was marked as outdated.
This comment was marked as outdated.
vszakats
approved these changes
Jul 14, 2023
Member
|
Thanks @tindarid! Merged now, with the extra two replacement in |
lampmanyao
pushed a commit
to lampmanyao/libssh2
that referenced
this pull request
Sep 3, 2023
Fixes compiling as dependency with FetchContent Co-authored-by: Viktor Szakats
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Fixes compiling as dependency with FetchContent Co-authored-by: Viktor Szakats
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Oct 22, 2024
It's counterintuitive but `PROJECT_*_DIR` seems to be the preferred variable to retrieve curl's root directory. In libssh2 this was done for this reason: "Fixes compiling as dependency with FetchContent" libssh2/libssh2#1121 curl already used `PROJECT_*_DIR` everywhere, except one place. Previous change: curl@72646c2 curl#488 curl#498 That previous fix didn't address the remaining CMAKE_BINARY_DIR inside the macro. Probably because the actual directory isn't relevant, just a mandatory argument of `try_compile()`. Newer CMake version allow for an improved argument list, where `BINARY_DIR` argument is optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes compiling as dependency with FetchContent