cmake: don't show outdated build options

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37291 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2011-01-22 09:27:06 +00:00
parent dc8adcf1ba
commit da246c7e44
2 changed files with 33 additions and 8 deletions

View File

@ -32,9 +32,9 @@ include(LyXMacros)
# 2. parameter: description
# 3. parameter: default value, ON or OFF
# 4. parameter: system on which option is used: ALL, GCC, MSVC, ...
message(STATUS)
message(STATUS "Switch LYX_* variables by -DLYX_*=1 or 0:")
message(STATUS)
LYX_OPTION_INIT()
LYX_OPTION(CPACK "Use the CPack management (Implies LYX_INSTALL option)" OFF ALL)
if(LYX_CPACK)
@ -473,6 +473,12 @@ if(LYX_INSTALL)
endif()
message(STATUS)
message(STATUS "Build options, switch LYX_* variables by -DLYX_*=1 or 0:")
message(STATUS)
LYX_OPTION_LIST_ALL()
set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
FILE(STRINGS "${TOP_SRC_DIR}/development/cmake/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)

View File

@ -232,6 +232,11 @@ macro(lyx_qt_resources_file _qrc_name _to_dir _list)
endmacro(lyx_qt_resources_file)
macro(LYX_OPTION_INIT)
set(LYX_OPTIONS)
endmacro()
macro(LYX_OPTION _name _description _default _sys)
set(_msg OFF)
if(${_sys} MATCHES "GCC")
@ -248,11 +253,25 @@ macro(LYX_OPTION _name _description _default _sys)
set(_msg ON)
endif()
endif()
if(_msg)
string(SUBSTRING "LYX_${_name} " 0 25 _var)
string(SUBSTRING "${LYX_${_name}} " 0 4 _val)
message(STATUS "${_var}: ${_val} (${_description})")
endif()
list(APPEND LYX_OPTIONS LYX_${_name})
set(LYX_${_name}_description ${_description})
set(LYX_${_name}_show_message ${_msg})
endmacro()
macro(LYX_OPTION_LIST_ALL)
foreach(_option ${LYX_OPTIONS})
if(${_option}_show_message)
string(SUBSTRING "${_option} " 0 25 _var)
if(${_option})
set(_isset ON)
else()
set(_isset OFF)
endif()
string(SUBSTRING "${_isset} " 0 4 _val)
message(STATUS "${_var}= ${_val} : ${${_option}_description}")
endif()
endforeach()
endmacro()
macro(lyx_add_info_files group)