LYX_OPTION(EXTERNAL_BOOST "Use external boost" OFF GCC)
LYX_OPTION(PROGRAM_SUFFIX "Append version suffix to binaries" ON GCC)
LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC)
-LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++pedantic 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(PROFILE "Build with options for gprof" OFF GCC)
# Check option dependencies
-if(LYX_CPACK)
- set(LYX_INSTALL ON)
-endif()
-
if(LYX_DMG)
set(LYX_BUNDLE ON)
set(LYX_CPACK ON)
endif()
+if(LYX_CPACK)
+ set(LYX_INSTALL ON)
+endif()
+
if(LYX_INSTALL)
set(LYX_NLS ON)
if (WIN32)
set(LYX_CONSOLE OFF)
endif()
set(LYX_PACKAGE_SUFFIX ON)
- set(LYX_RELEASE ON)
+ if(NOT LYX_DEBUG)
+ set(LYX_RELEASE ON)
+ endif()
set(LYX_PROFILE OFF)
endif()
set(USE_POSIX_PACKAGING ON)
endif()
-macro(setstripped _varname _value)
- string(STRIP ${_value} _v)
- if(USE_POSIX_PACKAGING)
- string(TOLOWER ${_v} ${_varname})
+macro(setstripped _varname)
+ if(${ARGC} GREATER 1)
+ string(STRIP "${ARGV1}" _v)
+ if(USE_POSIX_PACKAGING)
+ string(TOLOWER ${_v} ${_varname})
+ else()
+ set(${_varname} ${_v})
+ endif()
else()
- set(${_varname} ${_v})
+ set(${_varname})
endif()
endmacro(setstripped)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
endif()
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)
set(CMAKE_CXX_FLAGS_RELEASE "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE)
else()
endif()
endif()
+find_package(Qt5Core QUIET)
+if (Qt5Core_FOUND)
+ find_package(Qt5Widgets REQUIRED)
+ set(QTVERSION ${Qt5Core_VERSION})
+ macro (qt_use_modules)
+ qt5_use_modules(${ARGN})
+ endmacro()
+ macro (qt_add_resources)
+ qt5_add_resources(${ARGN})
+ endmacro()
+ macro (qt_wrap_uifiles)
+ qt5_wrap_ui(${ARGN})
+ endmacro()
+else()
+ find_package(Qt4 "4.5.0" REQUIRED)
+ macro (qt_use_modules)
+ endmacro()
+ macro (qt_add_resources)
+ qt4_add_resources(${ARGN})
+ endmacro()
+ macro (qt_wrap_uifiles)
+ qt4_wrap_ui(${ARGN})
+ endmacro()
+endif()
-find_package(Qt4 REQUIRED)
find_package(Magic)
if(Magic_FOUND)
set(HAVE_MAGIC_H 1)
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
endif()
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zc:wchar_t-")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zc:wchar_t-")
- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Zc:wchar_t-")
+
+ if (NOT Qt5Core_FOUND)
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zc:wchar_t-")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zc:wchar_t-")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Zc:wchar_t-")
+ endif()
message(STATUS "----- Warning level : ${CMAKE_CXX_WARNING_LEVEL} ${WARNING_LEVEL_MESSAGE}")
message(STATUS "----- Warnings as errors : ${MSVC_W_ERROR}")