2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# UseQt4
|
|
|
|
# ------
|
|
|
|
#
|
|
|
|
# Use Module for QT4
|
|
|
|
#
|
|
|
|
# Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake has
|
|
|
|
# already been loaded. See FindQt.cmake for information on how to load
|
|
|
|
# Qt 4 into your CMake project.
|
2005-12-14 21:51:08 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_definitions(${QT_DEFINITIONS})
|
2014-01-13 16:04:03 +04:00
|
|
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
|
2007-12-01 03:11:18 +03:00
|
|
|
|
2012-12-03 19:00:07 +04:00
|
|
|
if(QT_INCLUDE_DIRS_NO_SYSTEM)
|
|
|
|
include_directories(${QT_INCLUDE_DIR})
|
|
|
|
else(QT_INCLUDE_DIRS_NO_SYSTEM)
|
|
|
|
include_directories(SYSTEM ${QT_INCLUDE_DIR})
|
|
|
|
endif(QT_INCLUDE_DIRS_NO_SYSTEM)
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_LIBRARIES "")
|
|
|
|
set(QT_LIBRARIES_PLUGINS "")
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (QT_USE_QTMAIN)
|
|
|
|
if (Q_WS_WIN)
|
|
|
|
set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_DONT_USE_QTGUI)
|
|
|
|
set(QT_USE_QTGUI 0)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_USE_QTGUI 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2008-03-14 20:16:58 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_DONT_USE_QTCORE)
|
|
|
|
set(QT_USE_QTCORE 0)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_USE_QTCORE 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (QT_USE_QT3SUPPORT)
|
|
|
|
add_definitions(-DQT3_SUPPORT)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2008-05-20 02:07:00 +04:00
|
|
|
# list dependent modules, so dependent libraries are added
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
|
2013-10-23 17:03:18 +04:00
|
|
|
set(QT_QTSVG_MODULE_DEPENDS QTGUI QTCORE)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
|
|
|
|
set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
|
|
|
|
if(QT_QTDBUS_FOUND)
|
|
|
|
set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
|
|
|
|
set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
|
|
|
|
set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
set(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
set(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
set(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
|
|
|
|
set(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
|
|
|
|
set(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
set(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
set(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
|
|
|
|
set(QT_QTGUI_MODULE_DEPENDS QTCORE)
|
|
|
|
set(QT_QTTEST_MODULE_DEPENDS QTCORE)
|
|
|
|
set(QT_QTXML_MODULE_DEPENDS QTCORE)
|
|
|
|
set(QT_QTSQL_MODULE_DEPENDS QTCORE)
|
|
|
|
set(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
|
2006-09-06 16:31:50 +04:00
|
|
|
|
2008-03-14 20:16:58 +03:00
|
|
|
# Qt modules (in order of dependence)
|
2012-08-13 21:47:32 +04:00
|
|
|
foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
|
2010-05-06 23:12:46 +04:00
|
|
|
QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
|
2011-11-29 20:02:40 +04:00
|
|
|
QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
|
|
|
|
QTDBUS QTXML QTSQL QTNETWORK QTCORE)
|
2008-03-14 20:16:58 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
|
|
|
|
if (QT_${module}_FOUND)
|
|
|
|
if(QT_USE_${module})
|
|
|
|
string(REPLACE "QT" "" qt_module_def "${module}")
|
|
|
|
add_definitions(-DQT_${qt_module_def}_LIB)
|
2012-12-03 19:00:07 +04:00
|
|
|
if(QT_INCLUDE_DIRS_NO_SYSTEM)
|
|
|
|
include_directories(${QT_${module}_INCLUDE_DIR})
|
|
|
|
else(QT_INCLUDE_DIRS_NO_SYSTEM)
|
|
|
|
include_directories(SYSTEM ${QT_${module}_INCLUDE_DIR})
|
|
|
|
endif(QT_INCLUDE_DIRS_NO_SYSTEM)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2014-02-26 21:53:53 +04:00
|
|
|
if(QT_USE_${module} OR QT_IS_STATIC)
|
|
|
|
set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
|
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
|
|
|
|
if(QT_IS_STATIC)
|
|
|
|
set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
foreach(depend_module ${QT_${module}_MODULE_DEPENDS})
|
|
|
|
set(QT_USE_${depend_module}_DEPENDS 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
message("Qt ${module} library not found.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
2006-09-06 16:31:50 +04:00
|
|
|
|