]> git.lyx.org Git - lyx.git/commitdiff
cmake: make options more consistent
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 22 Jan 2011 10:53:54 +0000 (10:53 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 22 Jan 2011 10:53:54 +0000 (10:53 +0000)
Before we set LyX 2.0 in stone by releasing it,
I clean up the cmake's build option naming:

- only positive naming (remplace NO_, DISBALE_ names)
- short names when it is clear what the option means (no USE_)
- no redundant option RELEASE=0 is a debug build

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37293 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/build.bat

index 890f3b1f8ddaf7ba61d403fdc3758d9c13cc4913..74241664e9eceb7455d5060e9c58c66fda1ec6de 100644 (file)
@@ -48,10 +48,9 @@ if(LYX_INSTALL)
        if (WIN32)
                set(LYX_HUNSPELL ON CACHE BOOL "Hunspell option" FORCE)
        endif()
-       set(LYX_NO_CONSOLE ON CACHE BOOL "No console option" FORCE)
+       set(LYX_CONSOLE OFF CACHE BOOL "No console option" FORCE)
        set(LYX_PACKAGE_SUFFIX ON CACHE BOOL "Package suffix option" FORCE)
        set(LYX_RELEASE ON CACHE BOOL "Release option" FORCE)
-       set(LYX_DEBUG OFF CACHE BOOL "Debug option" FORCE)
        set(LYX_PROFILE OFF CACHE BOOL "Profile option" FORCE)
 endif()
 
@@ -59,19 +58,18 @@ LYX_OPTION(NLS "Use nls" OFF ALL)
 LYX_OPTION(ASPELL "Require aspell" OFF ALL)
 LYX_OPTION(ENCHANT "Require Enchant" OFF ALL)
 LYX_OPTION(HUNSPELL "Require Hunspell" OFF ALL)
-LYX_OPTION(DEBUG "Build debug version" OFF ALL)
 LYX_OPTION(DEVEL_VERSION "Build developer version" OFF ALL) 
-LYX_OPTION(RELEASE "Build release version" ON ALL)
+LYX_OPTION(RELEASE "Build release version, build debug when disabled" 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 ALL)
+LYX_OPTION(EXTERNAL_BOOST "Use external boost" OFF GCC)
+LYX_OPTION(EXTERNAL_LIBINTL "Use external libintl" ON ALL)
 LYX_OPTION(PACKAGE_SUFFIX "Use version suffix for packaging" ON ALL)
 LYX_OPTION(PROGRAM_SUFFIX "Append version suffix to binaries" ON GCC)
 LYX_OPTION(INSTALL_PREFIX "Install path for LyX" OFF ALL)
-LYX_OPTION(NO_CONSOLE "Suppress console on Windows" OFF MSVC)
+LYX_OPTION(CONSOLE "Show console on Windows" ON MSVC)
 LYX_OPTION(VLD "Use VLD with MSVC" OFF MSVC)
 LYX_OPTION(WALL "Enable all warnings" OFF MSVC)
-LYX_OPTION(DISABLE_PCH "Disable precompiled headers" ON ALL)
+LYX_OPTION(PCH "Use precompiled headers" OFF ALL)
 LYX_OPTION(MERGE_FILES "Merge source files into one compilation unit" OFF ALL)
 LYX_OPTION(MERGE_REBUILD "Rebuild generated files from merged files build" OFF ALL)
 LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC)
@@ -214,11 +212,9 @@ if(LYX_PROFILE)
 endif()
 
 if(LYX_RELEASE)
-       set(CMAKE_BUILD_TYPE Release CACHE TYPE STRING FORCE)
-endif()
-
-if(LYX_DEBUG)
-       set(CMAKE_BUILD_TYPE Debug CACHE TYPE STRING FORCE)
+       set(CMAKE_BUILD_TYPE Release CACHE STRING "Build release version" FORCE)
+else()
+       set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build debug version" FORCE)
 endif()
 
 # When shared libs are supported enable this option
@@ -282,14 +278,14 @@ if(LYX_NLS)
        add_subdirectory(po)
 endif()
 
-if(LYX_USE_EXTERNAL_LIBINTL)
+if(LYX_EXTERNAL_LIBINTL)
        find_package(Libintl REQUIRED)
        add_definitions(-DHAVE_GETTEXT) #TODO move to config.h
 else()
        add_subdirectory(intl)
 endif()
 
-if(LYX_USE_EXTERNAL_BOOST)
+if(LYX_EXTERNAL_BOOST)
        message(STATUS "Searching for boost")
        find_package(Boost COMPONENTS signals regex) #TODO could REQUIRED be used
        if(Boost_FOUND)
@@ -314,7 +310,7 @@ endif()
 
 
 if(WIN32)
-       if(LYX_NO_CONSOLE)
+       if(NOT LYX_CONSOLE)
                set(WIN32_CONSOLE WIN32)
                set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARY})
        endif()
@@ -345,7 +341,7 @@ message(STATUS "")
 # Not sure if it works for all non-msvc compilers
 include(PCHSupport_26)
 
-if(NOT LYX_DISABLE_PCH)
+if(LYX_PCH)
        configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
        configure_file(${CMAKE_SOURCE_DIR}/config.cpp.cmake ${CMAKE_BINARY_DIR}/config_pch.cpp)
        add_definitions(-DLYX_ENABLE_PCH)
@@ -373,7 +369,7 @@ if(NOT LYX_DISABLE_PCH)
                endmacro()
        endif()
 else()
-       set(LYX_DISABLE_PCH TRUE CACHE TYPE STRING)
+       set(LYX_PCH OFF CACHE STRING "Disaböe pre-compiled headers")
        macro(lyx_add_msvc_pch)
        endmacro(lyx_add_msvc_pch)
        macro(lyx_add_gcc_pch name_)
@@ -503,7 +499,7 @@ endif()
 if(ENCHANT_FOUND)
        set(CPACK_DEBIAN_PACKAGE_DEPENDS "libenchant1c2a (>= 1.6.0-0),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
 endif()
-if(LYX_USE_EXTERNAL_BOOST)
+if(LYX_EXTERNAL_BOOST)
        if(Boost_FOUND)
                set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.40.0 (>= 1.40.0-4),libboost-signals1.40.0 (>= 1.40.0-4),${CPACK_DEBIAN_PACKAGE_DEPENDS}")
        endif()
index 7c61c4ff37df3b22ff23197efb0bb6cb2de246b6..8da0f206a3908ab4636ea537f21f511634d5682d 100755 (executable)
@@ -79,7 +79,7 @@ if [%2]==[] (
 
 if "%1%" == "devel" (
        REM Build solution to develop LyX
-       cmake %LYX_SOURCE%\development\cmake -G%USED_STUDIO% -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_DEBUG=1
+       cmake %LYX_SOURCE%\development\cmake -G%USED_STUDIO% -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_RELEAE=0
        REM needed when running lyx from the debugger
        set LYX_DIR_20x=%LYX_SOURCE%\lib
        start lyx.sln /build Debug