cmake: only set and show compiler relevant options

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34803 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2010-07-07 22:26:36 +00:00
parent ef6de90bb5
commit 07eef68a90
2 changed files with 42 additions and 22 deletions

View File

@ -24,25 +24,32 @@ include(LyXMacros)
message(STATUS)
message(STATUS "Switch LYX_* variables by -DLYX_*=1 or 0:")
LYX_OPTION(NLS "Use nls" OFF)
LYX_OPTION(ASPELL "Require aspell" OFF)
LYX_OPTION(DEBUG "Build debug version" OFF)
LYX_OPTION(RELEASE "Build release version" ON)
LYX_OPTION(PROFILE "Build profile version" OFF)
LYX_OPTION(USE_EXTERNAL_BOOST "Use external boost" OFF)
LYX_OPTION(USE_EXTERNAL_LIBINTL "Use external libintl" ON)
LYX_OPTION(INSTALL "Build install projects/rules" ON)
LYX_OPTION(USE_VERSION_SUFFIX "Use version suffix for packaging" OFF)
LYX_OPTION(NO_CONSOLE "Suppress console on Windows" OFF)
LYX_OPTION(VLD "Use VLD on with MSVC" OFF)
LYX_OPTION(DISABLE_PCH "Disable precompiled headers" ON)
LYX_OPTION(MERGE_FILES "Merge source files into one compilation unit" OFF)
LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF)
LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++pedantic debug mode" OFF)
LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF)
LYX_OPTION(CONCEPT_CHECKS "Enable concept-checks" OFF)
LYX_OPTION(QUIET "Don't generate verbose makefiles" OFF)
LYX_OPTION(SHARED_LIBRARIES "Build shared libraries" OFF)
# Usage LYX_OPTION
# 1. parameter: option name without prefix 'LYX_'
# 2. parameter: description
# 3. parameter: default value, ON or OFF
# 4. parameter: system on which option is used: ALL, GCC, MSVC, ...
LYX_OPTION(NLS "Use nls" OFF ALL)
LYX_OPTION(ASPELL "Require aspell" OFF ALL)
LYX_OPTION(DEBUG "Build debug version" OFF ALL)
LYX_OPTION(RELEASE "Build release version" ON ALL)
LYX_OPTION(PROFILE "Build profile version" OFF GCC)
LYX_OPTION(USE_EXTERNAL_BOOST "Use external boost" OFF GCC)
LYX_OPTION(USE_EXTERNAL_LIBINTL "Use external libintl" ON GCC)
LYX_OPTION(INSTALL "Build install projects/rules" ON ALL)
LYX_OPTION(USE_VERSION_SUFFIX "Use version suffix for packaging" OFF ALL)
LYX_OPTION(NO_CONSOLE "Suppress console on Windows" OFF MSVC)
LYX_OPTION(VLD "Use VLD on with MSVC" OFF MSVC)
LYX_OPTION(DISABLE_PCH "Disable precompiled headers" ON ALL)
LYX_OPTION(MERGE_FILES "Merge source files into one compilation unit" OFF ALL)
LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC)
LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++pedantic debug mode" OFF GCC)
LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF GCC)
LYX_OPTION(CONCEPT_CHECKS "Enable concept-checks" OFF GCC)
LYX_OPTION(QUIET "Don't generate verbose makefiles" OFF ALL)
LYX_OPTION(SHARED_LIBRARIES "Build shared libraries" OFF ALL)
message(STATUS)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

View File

@ -227,9 +227,22 @@ macro(lyx_qt_resources_file _qrc_name _to_dir _list)
endmacro(lyx_qt_resources_file)
macro(LYX_OPTION _name _description _default)
option(LYX_${_name} ${_description} ${_default})
set(_msg ON)
macro(LYX_OPTION _name _description _default _sys)
set(_msg OFF)
if(${_sys} MATCHES "GCC")
set(_system CMAKE_COMPILER_IS_GNUCXX)
else()
set(_system ${_sys})
endif()
if(${_system} MATCHES "ALL")
option(LYX_${_name} ${_description} ${_default})
set(_msg ON)
else()
if(${${_system}})
option(LYX_${_name} ${_description} ${_default})
set(_msg ON)
endif()
endif()
if(_msg)
string(SUBSTRING "LYX_${_name} " 0 25 _var)
string(SUBSTRING "${LYX_${_name}} " 0 4 _val)