-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Bug
Generally find_package
is supposed to find a package and make it available in the current scope by default. If you call find_package
from two different scopes that are independent they should both succeed.
Currently, ystdlib uses include_guard(GLOBAL)
forcing CMake to elevate the guard to the global scope and preventing multiple find_package
calls from different scopes to succeed. Using include_guard()
(without the GLOBAL
flag) instead acts as an include guard in the current scope, meaning that it should prevent re-invocation in nested scopes, but won't prevent re-invocation in other independent scopes.
It is possible to have a find_package
call expose the package globally with a flag, but that is unrelated to the issue.
ystdlib-cpp version
Environment
CLP container, but should be reproducible on any environment.
Reproduction steps
- Create a project calling
find_package(ystdlib REQUIRED)
from multiple scopes. - Run cmake generation/configuration step.