[Kst] branches/work/kst/portto4/kst/cmake
Peter Kümmel
syntheticpp at gmx.net
Thu Jan 20 16:47:10 CET 2011
SVN commit 1215967 by kuemmel:
cmake: don't show outdated options
M +6 -5 CMakeLists.txt
M +17 -4 modules/KstMacros.cmake
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1215966:1215967
@@ -19,10 +19,8 @@
set(kst_binary_name kst)
-message(STATUS)
-message(STATUS "Build options:")
-message(STATUS)
+kst_option_init()
kst_option(release "Build release version" OFF all)
kst_option(merge_files "Merge files to speedup build about factor 5" OFF all)
kst_option(merge_rebuild "Rebuild generated files from merged files build" OFF all)
@@ -109,7 +107,6 @@
-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -144,11 +141,15 @@
include_directories(${CMAKE_BINARY_DIR} ${QT_INCLUDES})
-
message(STATUS "Build summary----------------------------------")
+message(STATUS)
message(STATUS "Version : ${kst_version}")
message(STATUS "Path to source : ${kst_dir}")
message(STATUS "Installation path: ${CMAKE_INSTALL_PREFIX}")
+message(STATUS)
+message(STATUS "Options:")
+kst_option_list_all()
+message(STATUS)
message(STATUS "-----------------------------------------------")
message(STATUS)
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1215966:1215967
@@ -193,6 +193,10 @@
endmacro()
+macro(kst_option_init)
+ set(kst_options)
+endmacro()
+
macro(kst_option _name _description _default _sys)
set(_msg OFF)
if(${_sys} MATCHES "gcc")
@@ -211,16 +215,25 @@
set(_msg ON)
endif()
endif()
- if(_msg)
- string(SUBSTRING "kst_${_name} " 0 25 _var)
- if(kst_${_name})
+ list(APPEND kst_options kst_${_name})
+ set(kst_${_name}_description ${_description})
+ set(kst_${_name}_show_message ${_msg})
+endmacro()
+
+
+macro(kst_option_list_all)
+ foreach(_option ${kst_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} : ${_description}")
+ message(STATUS "${_var}= ${_val} : ${${_option}_description}")
endif()
+ endforeach()
endmacro()
More information about the Kst
mailing list