Cmake build: Enable to install also a debug version

This commit is contained in:
Kornel Benko 2013-01-26 11:29:48 +01:00
parent 3fb94ca4e6
commit 28f5fcd56b

View File

@ -129,15 +129,15 @@ endif()
# Check option dependencies # Check option dependencies
if(LYX_CPACK)
set(LYX_INSTALL ON)
endif()
if(LYX_DMG) if(LYX_DMG)
set(LYX_BUNDLE ON) set(LYX_BUNDLE ON)
set(LYX_CPACK ON) set(LYX_CPACK ON)
endif() endif()
if(LYX_CPACK)
set(LYX_INSTALL ON)
endif()
if(LYX_INSTALL) if(LYX_INSTALL)
set(LYX_NLS ON) set(LYX_NLS ON)
if (WIN32) if (WIN32)
@ -149,7 +149,9 @@ if(LYX_INSTALL)
set(LYX_CONSOLE OFF) set(LYX_CONSOLE OFF)
endif() endif()
set(LYX_PACKAGE_SUFFIX ON) set(LYX_PACKAGE_SUFFIX ON)
set(LYX_RELEASE ON) if(NOT LYX_DEBUG)
set(LYX_RELEASE ON)
endif()
set(LYX_PROFILE OFF) set(LYX_PROFILE OFF)
endif() endif()
@ -237,12 +239,16 @@ else()
set(USE_POSIX_PACKAGING ON) set(USE_POSIX_PACKAGING ON)
endif() endif()
macro(setstripped _varname _value) macro(setstripped _varname)
string(STRIP ${_value} _v) if(${ARGC} GREATER 1)
if(USE_POSIX_PACKAGING) string(STRIP "${ARGV1}" _v)
string(TOLOWER ${_v} ${_varname}) if(USE_POSIX_PACKAGING)
string(TOLOWER ${_v} ${_varname})
else()
set(${_varname} ${_v})
endif()
else() else()
set(${_varname} ${_v}) set(${_varname})
endif() endif()
endmacro(setstripped) endmacro(setstripped)
@ -448,7 +454,7 @@ if(NOT MSVC)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS") set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
endif() endif()
set(CMAKE_CXX_FLAGS "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE TYPE STRING FORCE) set(CMAKE_CXX_FLAGS "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE TYPE STRING FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "${LYX_CXX_FLAGS} -fno-strict-aliasing -O0 -g -D_DEBUG" CACHE TYPE STRING FORCE) set(CMAKE_CXX_FLAGS_DEBUG "${LYX_CXX_FLAGS} -fno-strict-aliasing -O0 -g3 -D_DEBUG" CACHE TYPE STRING FORCE)
if(MINGW) if(MINGW)
set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE) set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE)
else() else()