[CMake] How to query compiler definitions?

Rolf Eike Beer eike at sf-mail.de
Thu Jan 20 14:43:51 EST 2011


> When you have such different "levels" of option you may do something like:
>
> OPTION(DEVELOPER_OPT_ENABLE  "Enable developer options" OFF)
> OPTION(SYSTEM_INTEGRATOR_OPT_ENABLE  "Enable system integrator
> specific options" OFF)
> OPTION(TOOL_USERS_OPT_ENABLE  "Enable tool users options" ON)
>
>> - software developers
>> - system integrators
>> - tool users
>
> then you do
>
> IF (DEVELOPER_OPT_ENABLE)
>     OPTION(DEV_OPT1 "blah blah" ON)
>     OPTION(DEV_OPT2 "blah blah" OFF)
> ENDIF(DEVELOPER_OPT_ENABLE)
>
> IF (TOOL_USERS_OPT_ENABLE)
>     OPTION(USR_OPT1 "blah blah" ON)
>     OPTION(USR_OPT2 "blah blah" OFF)
>     OPTION(USR_OPT3 "blah blah" ON)
> ENDIF(TOOL_USERS_OPT_ENABLE)
>
> so an option may perfectly depend on another option, such kind of config
> may need several "configure" steps but its works well (at least for me).

Sounds like you are searching for CMakeDependentOption. Search again in
the man page an you will find it ;)

Eike


More information about the CMake mailing list