mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-07 09:46:54 +00:00
Cmake build: Added user choise of QT version to use.
To use Qt5 one has to configure with: cmake .... -DLYX_USE_QT=QT5 Default is QT4, so on systems without Qt4 the QT5 choice is mandatory.
This commit is contained in:
parent
d13650974b
commit
a96a5ca5c8
@ -74,6 +74,11 @@ include(LyXMacros)
|
|||||||
# 3. parameter: default value, ON or OFF
|
# 3. parameter: default value, ON or OFF
|
||||||
# 4. parameter: system on which option is used: ALL, GCC, MSVC, ...
|
# 4. parameter: system on which option is used: ALL, GCC, MSVC, ...
|
||||||
|
|
||||||
|
# Usage LYX_COMBO
|
||||||
|
# 1. parameter: name without prefix 'LYX_'
|
||||||
|
# 2. parameter: description
|
||||||
|
# 3. parameter: default value
|
||||||
|
# 4-n parameter: possible other string values
|
||||||
|
|
||||||
LYX_OPTION_INIT()
|
LYX_OPTION_INIT()
|
||||||
|
|
||||||
@ -119,7 +124,7 @@ LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC)
|
|||||||
# APPLE specific
|
# APPLE specific
|
||||||
LYX_OPTION(DMG "Build as Mac bundle, needed for .dmg (experimental) " OFF MAC)
|
LYX_OPTION(DMG "Build as Mac bundle, needed for .dmg (experimental) " OFF MAC)
|
||||||
LYX_OPTION(COCOA "Use Cocoa on Mac" OFF MAC)
|
LYX_OPTION(COCOA "Use Cocoa on Mac" OFF MAC)
|
||||||
|
LYX_COMBO(USE_QT "Use Qt version as frontend" QT4 QT5)
|
||||||
|
|
||||||
if(help OR HELP)
|
if(help OR HELP)
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
@ -477,9 +482,11 @@ if(LYX_CXX_FLAGS_EXTRA)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt5Core QUIET)
|
if(LYX_USE_QT MATCHES "QT5")
|
||||||
if (Qt5Core_FOUND)
|
find_package(Qt5Core REQUIRED)
|
||||||
|
if (Qt5Core_FOUND)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
|
find_package(Qt5X11Extras)
|
||||||
set(QTVERSION ${Qt5Core_VERSION})
|
set(QTVERSION ${Qt5Core_VERSION})
|
||||||
macro (qt_use_modules)
|
macro (qt_use_modules)
|
||||||
qt5_use_modules(${ARGN})
|
qt5_use_modules(${ARGN})
|
||||||
@ -490,7 +497,8 @@ if (Qt5Core_FOUND)
|
|||||||
macro (qt_wrap_uifiles)
|
macro (qt_wrap_uifiles)
|
||||||
qt5_wrap_ui(${ARGN})
|
qt5_wrap_ui(${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
endif()
|
||||||
|
elseif(LYX_USE_QT MATCHES "QT4")
|
||||||
find_package(Qt4 "4.5.0" REQUIRED)
|
find_package(Qt4 "4.5.0" REQUIRED)
|
||||||
macro (qt_use_modules)
|
macro (qt_use_modules)
|
||||||
endmacro()
|
endmacro()
|
||||||
@ -500,6 +508,8 @@ else()
|
|||||||
macro (qt_wrap_uifiles)
|
macro (qt_wrap_uifiles)
|
||||||
qt4_wrap_ui(${ARGN})
|
qt4_wrap_ui(${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unhandled value for LYX_USE_QT (${LYX_USE_QT})")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Magic)
|
find_package(Magic)
|
||||||
@ -517,12 +527,12 @@ endif()
|
|||||||
if(LYX_ENCHANT)
|
if(LYX_ENCHANT)
|
||||||
find_package(Enchant REQUIRED)
|
find_package(Enchant REQUIRED)
|
||||||
include_directories(${ENCHANT_INCLUDE_DIR})
|
include_directories(${ENCHANT_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LYX_HUNSPELL)
|
if(LYX_HUNSPELL)
|
||||||
find_package(Hunspell REQUIRED)
|
find_package(Hunspell REQUIRED)
|
||||||
include_directories(${HUNSPELL_INCLUDE_DIR})
|
include_directories(${HUNSPELL_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LYX_NLS)
|
if(LYX_NLS)
|
||||||
FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
|
FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
|
||||||
@ -760,12 +770,12 @@ if(LYX_INSTALL)
|
|||||||
if(${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND")
|
if(${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND")
|
||||||
message(STATUS "Python required to create doc!")
|
message(STATUS "Python required to create doc!")
|
||||||
else()
|
else()
|
||||||
add_subdirectory(${LYX_CMAKE_DIR}/man "${TOP_BINARY_DIR}/man")
|
add_subdirectory(${LYX_CMAKE_DIR}/man "${TOP_BINARY_DIR}/man")
|
||||||
add_subdirectory(${LYX_CMAKE_DIR}/doc "${TOP_BINARY_DIR}/doc")
|
add_subdirectory(${LYX_CMAKE_DIR}/doc "${TOP_BINARY_DIR}/doc")
|
||||||
endif()
|
endif()
|
||||||
if(NOT(LYX_BUNDLE AND APPLE))
|
if(NOT(LYX_BUNDLE AND APPLE))
|
||||||
include(../Install)
|
include(../Install)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(sourcedoc "${TOP_BINARY_DIR}/sourcedoc")
|
add_subdirectory(sourcedoc "${TOP_BINARY_DIR}/sourcedoc")
|
||||||
@ -775,7 +785,7 @@ if(LYX_ENABLE_URLTESTS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
message(STATUS "Build options, switch LYX_* variables by -DLYX_*=ON or OFF:")
|
message(STATUS "Build params, switch LYX_* options by -DLYX_*=ON or OFF, LYX_* combos by -DLYX_*=value:")
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
LYX_OPTION_LIST_ALL(used)
|
LYX_OPTION_LIST_ALL(used)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
|
# Copyright (c) 2006-2011 Peter K<EFBFBD>mmel, <syntheticpp@gmx.net>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
@ -173,7 +173,7 @@ macro(lyx_const_touched_files _allinone_name _list)
|
|||||||
else()
|
else()
|
||||||
lyx_add_info_files(MergedFiles ${${_list}})
|
lyx_add_info_files(MergedFiles ${${_list}})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files})
|
set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files})
|
||||||
|
|
||||||
foreach (_current_FILE ${${_list}})
|
foreach (_current_FILE ${${_list}})
|
||||||
@ -232,6 +232,21 @@ macro(LYX_OPTION _name _description _default _sys)
|
|||||||
set(LYX_${_name}_show_message ${_msg})
|
set(LYX_${_name}_show_message ${_msg})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(LYX_COMBO _name _description _default)
|
||||||
|
set(_lyx_name "LYX_${_name}")
|
||||||
|
set(${_lyx_name} ${_default} CACHE STRING "${_description}")
|
||||||
|
set(_combo_list ${_default} ${ARGN})
|
||||||
|
set_property(CACHE ${_lyx_name} PROPERTY STRINGS ${_combo_list})
|
||||||
|
list(APPEND LYX_OPTIONS ${_lyx_name})
|
||||||
|
set(${_lyx_name}_show_message ON)
|
||||||
|
string(REGEX REPLACE ";" " " _use_list "${_combo_list}")
|
||||||
|
set(${_lyx_name}_description "${_description} (${_use_list})")
|
||||||
|
# Now check the value
|
||||||
|
list(FIND _combo_list ${${_lyx_name}} _idx)
|
||||||
|
if (_idx LESS 0)
|
||||||
|
message(FATAL_ERROR "${_lyx_name} set to \"${${_lyx_name}}\", but has to be only one of (${_use_list})")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro(LYX_OPTION_LIST_ALL)
|
macro(LYX_OPTION_LIST_ALL)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
@ -249,7 +264,10 @@ macro(LYX_OPTION_LIST_ALL)
|
|||||||
foreach(_option ${LYX_OPTIONS})
|
foreach(_option ${LYX_OPTIONS})
|
||||||
if(${_option}_show_message OR ${ARGV0} STREQUAL "help")
|
if(${_option}_show_message OR ${ARGV0} STREQUAL "help")
|
||||||
string(SUBSTRING "${_option} " 0 25 _var)
|
string(SUBSTRING "${_option} " 0 25 _var)
|
||||||
if(${_option})
|
get_property(_prop CACHE ${_option} PROPERTY STRINGS)
|
||||||
|
if(_prop)
|
||||||
|
set(_isset ${${_option}})
|
||||||
|
elseif(${_option})
|
||||||
set(_isset ON)
|
set(_isset ON)
|
||||||
else()
|
else()
|
||||||
set(_isset OFF)
|
set(_isset OFF)
|
||||||
|
Loading…
Reference in New Issue
Block a user