Skip to content
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

Do not define CONFIGURE_DEPENDS for library usage #632

Closed
BenjaminBeichler opened this issue Aug 10, 2021 · 0 comments · Fixed by #633
Closed

Do not define CONFIGURE_DEPENDS for library usage #632

BenjaminBeichler opened this issue Aug 10, 2021 · 0 comments · Fixed by #633

Comments

@BenjaminBeichler
Copy link
Contributor

If you include CLI11 in projects, it is a bit confusing, that it uses CONFIGURE_DEPENDS in its globbing, as normally the user do not add files to libraries. I would suggest adding the idiomatic check IF (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) before the for-loop, to only "reglob", if this is the main project.

CLI11/CMakeLists.txt

Lines 157 to 163 in 4d34311

# To see in IDE, headers must be listed for target
set(header-patterns "${PROJECT_SOURCE_DIR}/include/CLI/*")
if(NOT CMAKE_VERSION VERSION_LESS 3.12)
list(INSERT header-patterns 0 CONFIGURE_DEPENDS)
endif()
file(GLOB CLI11_headers ${header-patterns})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant