[CMake] How to query compiler definitions?

Eric Noulard eric.noulard at gmail.com
Thu Jan 20 16:44:53 EST 2011


2011/1/20 Rolf Eike Beer <eike at sf-mail.de>:
>> 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 ;)

Thank you Rolf
I didn't realized it already exists and never dare looking for it
since I was doint this "by hand" :-]

Will use it next time.



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list