-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature: Add user-provided input variable to override fair_get_git_version
#26
Comments
I haven't yet looked in detail at the use case! So just some general thoughts. From our docs:
I think, our idea back then was: The user (FairLogger in this case) can detect that (While reading the first paragraphas of the use case) Building from a tarball seems an interesting use case (you know I like that). But that one does not have a "GIT_VERSION", so Maybe we could create some new |
I think this feature is basically already supported. In addition to the logic we already document, we could more strongly define the output variable to be a CMake cache variable, which then gives user-overridability naturally out-of-the-box. |
Okay, having read the "use case".
is already well supported usage of We could add a note to our docs like this?
WARNING: I haven't tested the |
About cache value interaction: macro(show title)
message(STATUS "${title}")
message(STATUS " val: [${FOO}]")
message(STATUS " cache: [$CACHE{FOO}]")
endmacro()
function(something)
set(FOO "other val" PARENT_SCOPE)
endfunction()
show("At Start")
something()
show("After Function Call")
set(FOO "${FOO}" CACHE STRING "My FOO")
show("After Marking as Cache") $ cmake -P foo.cmake
-- At Start
-- val: []
-- cache: []
-- After Function Call
-- val: [other val]
-- cache: []
-- After Marking as Cache
-- val: [other val]
-- cache: [other val]
$ cmake -DFOO=bar -P foo.cmake
-- At Start
-- val: [bar]
-- cache: [bar]
-- After Function Call
-- val: [other val]
-- cache: [bar]
-- After Marking as Cache
-- val: [bar]
-- cache: [bar] So "the project" has full control over which variant they want. Projects just wanting a "fallback" do not need to do anything special. Just use And then there are are various simple snippet ideas (UNTESTED!):
|
New idea for adding docs:
|
See alisw/alidist#3945 for the use case.
The text was updated successfully, but these errors were encountered: