Warning, /acts/cmake/ActsOptionHelpers.cmake is written in an unsupported language. File is not indexed.
0001 # Provide helper macros to handle option interdependencies.
0002 #
0003 # Ensure an option is set if a condition is met. Can be used to encode
0004 # dependencies between different options, e.g. if OptionA is on, OptionB has
0005 # to be on as well.
0006 #
0007 # set_option_if(OptionB OptionA)
0008 #
0009 # The macro can take arbitrary conditions as the second parameter, e.g.
0010 #
0011 # set_option_if(OptionB OptionA AND ConditionB OR ConditionC)
0012 #
0013
0014 macro(set_option_if option)
0015 if(${ARGN})
0016 # create a regular (directory-scope) variable that should take precedence
0017 # over a cache entry of the same name. that means that automatically
0018 # activated options are not stored in the cache.
0019 set(${option} ON)
0020 endif()
0021 endmacro()