I'd like to know how to get variables and options from an external project. For example, I'm using ExternalProject_Add
to add a library that my project depends on, the thing is that this dependency has some variables and options - some of them are on by default - I'm wondering, how to get them from my CMakeLists.txt
.
All commands related with ExternalProject_Add
are executed at build stage, but your CMakeLists.txt
is interpreted at configure stage, when external library hasn't configured yet, so its variables and options are not defined.
More general, cmake variable from the external project can be extracted in two cases:
add_subdirectory
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With