-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
ProjectOptions_SRC_DIR is now cached as INTERNAL #163
Conversation
src/Index.cmake
Outdated
@@ -11,7 +11,7 @@ endif() | |||
include_guard() | |||
|
|||
# only useable here | |||
set(ProjectOptions_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}) | |||
set(ProjectOptions_SRC_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must not a CMakeCache
variable because if more than one subproject use this ProjectOptions independently, there is a name clash!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add a note about this. If someone uses project options in multiple submodules, it can result in errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue we're running into is that this variable is seemingly out of scope by the time a lot of project_option macros are called. The only solution I can think of would be to call the includes before macro definitions – but I'm not sure what the impact on build times would be since I guess the inclusions are delayed intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue we're running into is that this variable is seemingly out of scope by the time a lot of project_option macros are called. The only solution I can think of would be to call the includes before macro definitions – but I'm not sure what the impact on build times would be since I guess the inclusions are delayed intentionally?
you may try to change the project_options/CMakeLists.txt and append the CMAKE_MODULE_PATH
...
083525c
to
41a7403
Compare
Fixes #161