2005-12-14 21:51:08 +03:00
|
|
|
# - 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.
|
|
|
|
|
2009-09-28 19:46:51 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2005-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:46:51 +04:00
|
|
|
# License text for the above reference.)
|
2005-09-08 17:58:41 +04:00
|
|
|
|
|
|
|
ADD_DEFINITIONS(${QT_DEFINITIONS})
|
2008-02-01 20:02:19 +03:00
|
|
|
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
|
|
|
|
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
|
|
|
|
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
|
|
|
|
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
|
2011-06-23 20:08:28 +04:00
|
|
|
IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
|
|
|
|
ENDIF()
|
2007-12-01 03:11:18 +03:00
|
|
|
|
2005-09-08 17:58:41 +04:00
|
|
|
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
|
|
|
|
|
|
|
|
SET(QT_LIBRARIES "")
|
2011-07-21 06:28:32 +04:00
|
|
|
SET(QT_LIBRARIES_PLUGINS "")
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2006-09-06 16:31:50 +04:00
|
|
|
IF (QT_USE_QTMAIN)
|
2010-07-03 01:43:38 +04:00
|
|
|
IF (Q_WS_WIN)
|
2006-09-06 16:31:50 +04:00
|
|
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
|
2010-07-03 01:43:38 +04:00
|
|
|
ENDIF (Q_WS_WIN)
|
2006-09-06 16:31:50 +04:00
|
|
|
ENDIF (QT_USE_QTMAIN)
|
2005-09-08 17:58:41 +04:00
|
|
|
|
2008-03-14 20:16:58 +03:00
|
|
|
IF(QT_DONT_USE_QTGUI)
|
|
|
|
SET(QT_USE_QTGUI 0)
|
|
|
|
ELSE(QT_DONT_USE_QTGUI)
|
|
|
|
SET(QT_USE_QTGUI 1)
|
|
|
|
ENDIF(QT_DONT_USE_QTGUI)
|
|
|
|
|
|
|
|
IF(QT_DONT_USE_QTCORE)
|
|
|
|
SET(QT_USE_QTCORE 0)
|
|
|
|
ELSE(QT_DONT_USE_QTCORE)
|
|
|
|
SET(QT_USE_QTCORE 1)
|
|
|
|
ENDIF(QT_DONT_USE_QTCORE)
|
2005-09-08 17:58:41 +04:00
|
|
|
|
|
|
|
IF (QT_USE_QT3SUPPORT)
|
2006-10-04 22:00:41 +04:00
|
|
|
ADD_DEFINITIONS(-DQT3_SUPPORT)
|
2005-09-08 17:58:41 +04:00
|
|
|
ENDIF (QT_USE_QT3SUPPORT)
|
|
|
|
|
2008-05-20 02:07:00 +04:00
|
|
|
# list dependent modules, so dependent libraries are added
|
2008-03-14 20:16:58 +03:00
|
|
|
SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
|
|
|
|
SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
|
|
|
|
SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
|
2009-10-02 00:12:39 +04:00
|
|
|
SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
|
2008-11-06 00:54:26 +03:00
|
|
|
IF(QT_QTDBUS_FOUND)
|
|
|
|
SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
|
|
|
|
ELSE(QT_QTDBUS_FOUND)
|
|
|
|
SET(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
ENDIF(QT_QTDBUS_FOUND)
|
2008-03-14 20:16:58 +03:00
|
|
|
SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
|
|
|
|
SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
|
2009-02-06 07:01:38 +03:00
|
|
|
SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
|
|
|
|
SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
|
2009-05-06 17:42:01 +04:00
|
|
|
SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
|
2010-02-18 03:12:18 +03:00
|
|
|
SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
|
2011-11-29 20:02:40 +04:00
|
|
|
SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
|
2010-05-06 23:12:46 +04:00
|
|
|
SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
|
2011-06-14 03:37:26 +04:00
|
|
|
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)
|
|
|
|
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
|
|
|
|
2008-05-20 02:07:00 +04:00
|
|
|
IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
|
2008-03-14 20:16:58 +03:00
|
|
|
IF (QT_${module}_FOUND)
|
|
|
|
IF(QT_USE_${module})
|
|
|
|
STRING(REPLACE "QT" "" qt_module_def "${module}")
|
|
|
|
ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
|
|
|
|
INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
|
|
|
|
ENDIF(QT_USE_${module})
|
2009-12-16 00:16:45 +03:00
|
|
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
|
2011-07-21 06:28:32 +04:00
|
|
|
SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
|
2009-12-16 00:16:45 +03:00
|
|
|
IF(QT_IS_STATIC)
|
|
|
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
|
|
|
|
ENDIF(QT_IS_STATIC)
|
2008-03-14 20:16:58 +03:00
|
|
|
FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
2008-05-20 02:07:00 +04:00
|
|
|
SET(QT_USE_${depend_module}_DEPENDS 1)
|
2008-03-14 20:16:58 +03:00
|
|
|
ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
|
|
|
ELSE (QT_${module}_FOUND)
|
|
|
|
MESSAGE("Qt ${module} library not found.")
|
|
|
|
ENDIF (QT_${module}_FOUND)
|
2008-05-20 02:07:00 +04:00
|
|
|
ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
|
2008-03-14 20:16:58 +03:00
|
|
|
|
|
|
|
ENDFOREACH(module)
|
2006-09-06 16:31:50 +04:00
|
|
|
|