[CMake] Dependent options (was Re: Questions on features)

E. Wing ewmailing at gmail.com
Sat Sep 6 00:07:23 EDT 2008


>> 3) Assume you have a lot of features to select including dependencies.
>> How can I realize to set a dependent feature in the CMake GUI setup, if
>> another is changed?
>>     Example 1: your car can have a "radio" (bool) and "mp3" (bool). If
>> you select "mp3"=ON, "radio" is also set to ON.
>>
>
> This can be done, but my way is really ugly (especially if you then
> want to remove the option again when you turn the parent OFF).

Ah, I found that a MACRO already exists for this in
CMakeDependentOption.cmake. It seems strangely familiar to me, but I
don't know why.

-Eric


More information about the CMake mailing list