]> git.lyx.org Git - features.git/commitdiff
cmake: only set and show compiler relevant options
authorPeter Kümmel <syntheticpp@gmx.net>
Wed, 7 Jul 2010 22:26:36 +0000 (22:26 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Wed, 7 Jul 2010 22:26:36 +0000 (22:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34803 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/modules/LyXMacros.cmake

index 7f5bdf58dae96c5c497d4c3a04bb9c5fac92111a..d9426b63b110513ea193c8537f533ef5c47d127d 100644 (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)
index d85b6aa9f4a241b4d8e59330c65cf38cceb5b0dd..1643e880bcdc114d4586ba0757342511b32de468 100644 (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)