I want to pass configuration options (some STRINGs and BOOLs) to a subdirectory with its own CMake project. What is the correct way to do this since all three methods I have found, have major flaws?
- set(CACHE): You need to use set(CACHE) in the parent project as well, since it cache variables and normal variables don't interact in any logical manner (and it changes depending on the policy). Also you have to set the variable description in the the parent project, which also makes no sense.
- set(): Not an option since you cannot set any defaults except with a lot of if-statements.
- option(): Useless since you can only use BOOLs with it.
Is there something that I am missing? How do big projects handle this kind of problem?
Thanks in advance :)