Warning, /office/kexi/cmake/modules/KexiAddSimpleOption.cmake is written in an unsupported language. File is not indexed.
0001 # Additional CMake macros
0002 #
0003 # Copyright (C) 2015-2017 Jarosław Staniek <staniek@kde.org>
0004 #
0005 # Redistribution and use is allowed according to the terms of the BSD license.
0006 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0007
0008 if(__kexi_add_simple_option)
0009 return()
0010 endif()
0011 set(__kexi_add_simple_option YES)
0012
0013 include(FeatureSummary)
0014
0015 # Adds a feature info using add_feature_info() with _NAME and _DESCRIPTION.
0016 # If _NAME is equal to _DEFAULT, shows this fact.
0017 macro(add_simple_feature_info _NAME _DESCRIPTION _DEFAULT)
0018 if("${_DEFAULT}" STREQUAL "${${_NAME}}")
0019 set(_STATUS " (default value)")
0020 else()
0021 set(_STATUS "")
0022 endif()
0023 add_feature_info(${_NAME} ${_NAME} ${_DESCRIPTION}${_STATUS})
0024 endmacro()
0025
0026 # Adds a simple option using option() with _NAME and _DESCRIPTION and a feature
0027 # info for it using add_simple_feature_info(). If _NAME is equal to _DEFAULT, shows this fact.
0028 macro(simple_option _NAME _DESCRIPTION _DEFAULT)
0029 option(${_NAME} ${_DESCRIPTION} ${_DEFAULT})
0030 add_simple_feature_info(${_NAME} ${_DESCRIPTION} ${_DEFAULT})
0031 endmacro()