From da246c7e44f9733be23ea6b3652845c7c31e997a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Sat, 22 Jan 2011 09:27:06 +0000 Subject: [PATCH] cmake: don't show outdated build options git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37291 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/CMakeLists.txt | 12 +++++++--- development/cmake/modules/LyXMacros.cmake | 29 +++++++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index 1df394a285..890f3b1f8d 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -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) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index e3de37c02c..d67a38280a 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -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)