LYX_OPTION(MERGE_REBUILD "Rebuild generated files from merged files build" OFF ALL)
LYX_OPTION(QUIET "Don't generate verbose makefiles" OFF ALL)
LYX_OPTION(INSTALL_PREFIX "Install path for LyX" OFF ALL)
-LYX_OPTION(EXTERNAL_LIBINTL "Use external libintl" ON ALL)
LYX_OPTION(BUNDLE "Build bundle (experimental) " OFF ALL)
# GCC specific
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)
if(LYX_NLS)
FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
- if(${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND")
- message(FATAL_ERROR "Python 2.6 needed!")
- endif()
- find_package(LyXGettext REQUIRED)
- add_subdirectory(po "${TOP_BINARY_DIR}/po")
-endif()
-
-if(LYX_NLS)
- if(LYX_EXTERNAL_LIBINTL)
- find_package(Libintl REQUIRED)
- if(DEFINED LIBINTL_LIBRARIES)
- # find getext when configuring
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIBRARIES})
- # on mac use iconv also form ports
- get_filename_component(ICONV_RELATIVE_TO_LIBINTL ${LIBINTL_LIBRARIES} PATH)
- endif()
+ find_package(LyXGettext)
+ if(LYX_PYTHON_EXECUTABLE AND GETTEXT_FOUND)
+ add_subdirectory(po "${TOP_BINARY_DIR}/po")
else()
- add_subdirectory(intl "${TOP_BINARY_DIR}/intl")
+ # Install only supplied .gmo-files
+ file(GLOB _gmofiles RELATIVE "${TOP_SRC_DIR}/po" "${TOP_SRC_DIR}/po/*.gmo")
+ message(STATUS "Installing provided .gmo-files only")
+ foreach( _gmo ${_gmofiles})
+ string(REGEX REPLACE "\\.gmo$" "" _lang ${_gmo})
+ install(FILES "${TOP_SRC_DIR}/po/${_gmo}" DESTINATION ${LYX_DATA_SUBDIR}${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${PACKAGE}.mo)
+ endforeach()
endif()
endif()
-if(LYX_EXTERNAL_LIBINTL)
- set(intl_link ${LIBINTL_LIBRARIES})
-else()
- set(intl_link intl)
-endif()
-
find_package(ICONV REQUIRED)
find_package(ZLIB REQUIRED)
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}")
MESSAGE(STATUS "---- Using XCode compiler CMAKE_XCODE_ATTRIBUTE_GCC_VERSION=${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION}")
ENDIF(CMAKE_GENERATOR MATCHES Xcode)
+if (WIN32 AND Qt5Core_FOUND)
+ set(Z_PREFIX 1)
+endif()
# compiler tests, config.h generation
if(MSVC AND NOT LYX_CONFIGURE_CHECKS)
message(STATUS)
message(STATUS "Building Native Language Support (LYX_NLS is set), used libraries:")
message(STATUS)
- message(STATUS " * intl")
- message(STATUS " - header : ${LIBINTL_HEADER}")
- message(STATUS " - library: ${LIBINTL_LIBRARIES}")
message(STATUS " * iconv")
message(STATUS " - header : ${ICONV_HEADER}")
message(STATUS " - library: ${ICONV_LIBRARY}")