-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add support for conditional dependencies via INCLUDE_IF keyword. #394
base: master
Are you sure you want to change the base?
Conversation
See cpm-cmake#391 for more details.
if(DEFINED CPM_ARGS_INCLUDE_IF) | ||
|
||
# Filter out INCLUDE_IF from arguments | ||
cpm_remove_one_value_arg(INCLUDE_IF ARGN ${ARGN}) |
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 function currently assumes that the user has always supplied a value for INCLUDE_IF
.
That might be okay, but for CMake 3.15 and newer, we could also check if INCLUDE_IF
is not in CPM_ARGS_KEYWORDS_MISSING_VALUES
and otherwise inform this function about the fact that there is no value to be removed (see cmake_parse_arguments docs.
I'm against this. I'm pasting my comment from the linked discussion: The proposed solutions would only work if all packages are listed in a central But packages are listed in multiple CMakeLists files. My root can have code like: if(BUILD_SERVER)
add_subdirectory(server)
endif()
if(BUILD_CLIENT)
add_subdirectory(client)
endif() In such case the dependencies of the client won't even be mentioned, if only Thinking about all edge cases and different scenarios I'm even inclined to propose ditching package-lock altogether. Has anyone made a good use of it? |
I think that package-lock should be at least rethought before proceeding with such changes |
Yeah I definitely hadn't given it enough thought until now. Also sharing my comment from the discussion for completeness.
|
Still a work in progress. See #391 for more details.
To do (amongst other things probably):