2016-10-08 19:07:28 +02:00
|
|
|
cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR)
|
|
|
|
|
2017-02-11 02:31:43 +01:00
|
|
|
if(NOT BASIC_PROJECT_CONFIG_DONE)
|
2017-02-20 20:04:33 +01:00
|
|
|
message(FATAL_ERROR "Before including the QtGuiConfig module, the BasicConfig module must be included.")
|
2017-02-11 02:31:43 +01:00
|
|
|
endif()
|
|
|
|
if(QT_CONFIGURED)
|
2017-02-20 20:04:33 +01:00
|
|
|
message(FATAL_ERROR "The QtGuiConfig module can not be included when Qt usage has already been configured.")
|
2017-02-11 02:31:43 +01:00
|
|
|
endif()
|
|
|
|
if(TARGET_CONFIG_DONE)
|
|
|
|
message(FATAL_ERROR "Can not include QtGuiConfig module when targets are already configured.")
|
|
|
|
endif()
|
|
|
|
|
2016-04-16 00:50:31 +02:00
|
|
|
# enable Qt Widgets GUI
|
2016-07-10 00:22:20 +02:00
|
|
|
if(WIDGETS_GUI)
|
2016-11-08 19:57:57 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS GUI_QTWIDGETS MODEL_UNDO_SUPPORT)
|
2016-04-16 00:50:31 +02:00
|
|
|
list(APPEND WIDGETS_FILES ${WIDGETS_HEADER_FILES} ${WIDGETS_SRC_FILES} ${WIDGETS_RES_FILES} ${WIDGETS_UI_FILES})
|
2016-04-16 18:32:56 +02:00
|
|
|
list(APPEND ADDITIONAL_HEADER_FILES ${WIDGETS_HEADER_FILES})
|
2016-04-16 00:50:31 +02:00
|
|
|
if(WIDGETS_FILES)
|
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Widgets)
|
|
|
|
message(STATUS "Building with Qt Widgets GUI.")
|
|
|
|
else()
|
|
|
|
message(STATUS "Qt Widgets GUI is not available.")
|
|
|
|
endif()
|
|
|
|
else()
|
2016-07-10 00:22:20 +02:00
|
|
|
message(STATUS "Building WITHOUT Qt Widgets GUI.")
|
2016-04-16 00:50:31 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# enable Qt Quick GUI
|
2016-07-10 00:22:20 +02:00
|
|
|
if(QUICK_GUI)
|
2016-11-08 19:57:57 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS GUI_QTQUICK)
|
2016-04-16 00:50:31 +02:00
|
|
|
list(APPEND QML_FILES ${QML_HEADER_FILES} ${QML_SRC_FILES} ${QML_RES_FILES})
|
2016-04-16 18:32:56 +02:00
|
|
|
list(APPEND ADDITIONAL_HEADER_FILES ${QML_HEADER_FILES})
|
2016-04-16 00:50:31 +02:00
|
|
|
if(QML_FILES)
|
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Quick)
|
2016-07-16 23:12:02 +02:00
|
|
|
list(APPEND ADDITIONAL_QT_REPOS "declarative")
|
2016-04-16 00:50:31 +02:00
|
|
|
message(STATUS "Building with Qt Quick GUI.")
|
|
|
|
else()
|
|
|
|
message(STATUS "Qt Quick GUI is not available.")
|
|
|
|
endif()
|
|
|
|
else()
|
2016-07-10 00:22:20 +02:00
|
|
|
message(STATUS "Building WITHOUT Qt Quick GUI.")
|
2016-04-16 00:50:31 +02:00
|
|
|
endif()
|
|
|
|
|
2016-08-19 16:16:10 +02:00
|
|
|
if(WIDGETS_GUI OR QUICK_GUI)
|
2017-03-29 00:17:26 +02:00
|
|
|
# set "GUI-type" to WIN32 to hide console under Windows
|
2016-08-19 16:16:10 +02:00
|
|
|
if(WIN32)
|
|
|
|
set(GUI_TYPE WIN32)
|
2017-03-29 00:17:26 +02:00
|
|
|
elseif(APPLE)
|
|
|
|
set(GUI_TYPE MACOSX_BUNDLE)
|
2016-08-19 16:16:10 +02:00
|
|
|
endif()
|
2016-07-27 18:51:25 +02:00
|
|
|
|
2016-10-29 00:26:06 +02:00
|
|
|
# add source files requried by both GUI variants
|
2016-07-27 18:51:25 +02:00
|
|
|
list(APPEND SRC_FILES ${GUI_SRC_FILES})
|
|
|
|
list(APPEND ADDITIONAL_HEADER_FILES ${GUI_HEADER_FILES})
|
2016-04-16 00:50:31 +02:00
|
|
|
endif()
|
2016-08-19 16:16:10 +02:00
|
|
|
|
2016-08-19 22:37:43 +02:00
|
|
|
# add option for enabling/disabling static Qt plugins
|
2016-10-08 19:07:28 +02:00
|
|
|
if("Svg" IN_LIST ADDITIONAL_QT_MODULES)
|
|
|
|
# Qt Svg module is not optional
|
|
|
|
set(SVG_SUPPORT ON)
|
|
|
|
else()
|
|
|
|
option(SVG_SUPPORT "enables/disables svg support for Qt GUI" OFF)
|
|
|
|
endif()
|
2016-08-19 22:37:43 +02:00
|
|
|
option(SVG_ICON_SUPPORT "enables/disables svg icon support for Qt GUI (only affects static builds where QSvgPlugin will be built-in if enabled)" ON)
|