-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
cmake: replace CURL_*_DIR
with {PROJECT,CMAKE_CURRENT}_*_DIR
#15331
Closed
Conversation
This file contains 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
vszakats
changed the title
cmake: rename
[WIP] cmake: rename Oct 18, 2024
CURL_*_DIR
to CMAKE_CURRENT_*_DIR
CURL_*_DIR
to CMAKE_CURRENT_*_DIR
vszakats
changed the title
[WIP] cmake: rename
[WIP] cmake: replace Oct 18, 2024
CURL_*_DIR
to CMAKE_CURRENT_*_DIR
CURL_*_DIR
variables
vszakats
changed the title
[WIP] cmake: replace
[WIP] cmake: replace Oct 18, 2024
CURL_*_DIR
variablesCURL_*_DIR
variables with generic ones
vszakats
changed the title
[WIP] cmake: replace
cmake: replace Oct 18, 2024
CURL_*_DIR
variables with generic onesCURL_*_DIR
variables with generic ones
vszakats
force-pushed
the
cm-tidy-project-root-var
branch
from
October 18, 2024 11:49
f98609a
to
c6d4c54
Compare
vszakats
changed the title
cmake: replace
cmake: replace Oct 18, 2024
CURL_*_DIR
variables with generic onesCURL_*_DIR
variables with {PROJECT,CMAKE_CURRENT}_*_DIR
vszakats
changed the title
cmake: replace
cmake: replace Oct 18, 2024
CURL_*_DIR
variables with {PROJECT,CMAKE_CURRENT}_*_DIR
CURL_*_DIR
with {PROJECT,CMAKE_CURRENT}_*_DIR
vszakats
force-pushed
the
cm-tidy-project-root-var
branch
3 times, most recently
from
October 22, 2024 11:03
23ddb17
to
9babf14
Compare
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.
vszakats
force-pushed
the
cm-tidy-project-root-var
branch
from
October 22, 2024 13:18
9babf14
to
270df5f
Compare
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.
It reduces the number of synonym variables in the code.
Makes it easier to grok and grep.
replace
CURL_SOURCE_DIR
with
PROJECT_SOURCE_DIR
.replace
CURL_BINARY_DIR
with
PROJECT_BINARY_DIR
orCMAKE_CURRENT_BINARY_DIR
.replace a single use of
CMAKE_BINARY_DIR
with
PROJECT_BINARY_DIR
.replace
CMAKE_CURRENT_*_DIR
with
PROJECT_*_DIR
where it makes the code more uniform.quote an argument (formatting).
CMAKE_SOURCE_DIR
andCMAKE_BINARY_DIR
as an alternative forPROJECT_*
.