Dear All,

I'm plagued by an issue that I do not understand. An if-statement
(in a package configuration file) evaluates ON to false:

    ...some code here

The part inside IF is *not* executed. Replacing ON by TRUE does not
help, only replacing it by 1 helps. Is this correct behaviour? I can
not understand this from the documentation. The docs seem to say "ON"
would be a valid token for true:

The full user story is that in the package configuration I'd like to
treat shared libraries specially, so I use "IF(@BUILD_SHARED_LIBS@)".
The user configures the build with


so the package configuration gets resolved to "IF(ON)". I have not
too much control about the way users specify the options, so I'd
like to solve this on my end. If options should not keep the value
"ON", how can I cleanly resolve them to the corresponding number 0/1?

Am I doing something wrong?

All the best,

    Mario Emmenlauer

BioDataAnalysis GmbH, Mario Emmenlauer     Tel. Office: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer *
D-81669 Munich                 

Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

Reply via email to