2005-12-14 21:51:08 +03:00
|
|
|
# - Find QT 4
|
|
|
|
# This module can be used to find Qt4.
|
2006-04-27 23:07:23 +04:00
|
|
|
# The most important issue is that the Qt4 qmake is available via the system path.
|
|
|
|
# This qmake is then used to detect basically everything else.
|
2006-05-20 00:57:49 +04:00
|
|
|
# This module defines a number of key variables and macros. First is
|
2005-12-15 22:17:43 +03:00
|
|
|
# QT_USE_FILE which is the path to a CMake file that can be included to compile
|
2006-05-20 00:57:49 +04:00
|
|
|
# Qt 4 applications and libraries. By default, the QtCore and QtGui
|
|
|
|
# libraries are loaded. This behavior can be changed by setting one or more
|
2005-12-15 22:17:43 +03:00
|
|
|
# of the following variables to true:
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_DONT_USE_QTCORE
|
|
|
|
# QT_DONT_USE_QTGUI
|
|
|
|
# QT_USE_QT3SUPPORT
|
|
|
|
# QT_USE_QTASSISTANT
|
|
|
|
# QT_USE_QTDESIGNER
|
|
|
|
# QT_USE_QTMOTIF
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_USE_QTMAIN
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_USE_QTNETWORK
|
|
|
|
# QT_USE_QTNSPLUGIN
|
|
|
|
# QT_USE_QTOPENGL
|
|
|
|
# QT_USE_QTSQL
|
|
|
|
# QT_USE_QTXML
|
2006-04-27 23:07:23 +04:00
|
|
|
#
|
2006-05-20 00:57:49 +04:00
|
|
|
# All the libraries required are stored in a variable called QT_LIBRARIES.
|
2005-12-15 22:17:43 +03:00
|
|
|
# Add this variable to your TARGET_LINK_LIBRARIES.
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-12-14 21:51:08 +03:00
|
|
|
# macro QT4_WRAP_CPP(outfiles inputfile ... )
|
|
|
|
# macro QT4_WRAP_UI(outfiles inputfile ... )
|
|
|
|
# macro QT4_ADD_RESOURCE(outfiles inputfile ... )
|
2006-04-27 23:07:23 +04:00
|
|
|
# macro QT4_AUTOMOC(inputfile ... )
|
|
|
|
# macro QT4_GENERATE_MOC(inputfile outputfile )
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-12-15 22:17:43 +03:00
|
|
|
# QT_FOUND If false, don't try to use Qt.
|
|
|
|
# QT4_FOUND If false, don't try to use Qt 4.
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_QTCORE_FOUND True if QtCore was found.
|
|
|
|
# QT_QTGUI_FOUND True if QtGui was found.
|
|
|
|
# QT_QT3SUPPORT_FOUND True if Qt3Support was found.
|
|
|
|
# QT_QTASSISTANT_FOUND True if QtAssistant was found.
|
|
|
|
# QT_QTDESIGNER_FOUND True if QtDesigner was found.
|
|
|
|
# QT_QTMOTIF_FOUND True if QtMotif was found.
|
|
|
|
# QT_QTNETWORK_FOUND True if QtNetwork was found.
|
|
|
|
# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
|
|
|
|
# QT_QTOPENGL_FOUND True if QtOpenGL was found.
|
|
|
|
# QT_QTSQL_FOUND True if QtSql was found.
|
|
|
|
# QT_QTXML_FOUND True if QtXml was found.
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_QTSVG_FOUND True if QtSvg was found.
|
|
|
|
# QT_QTTEST_FOUND True if QtTest was found.
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
|
|
|
# QT_INCLUDES List of paths to all include directories of
|
2006-04-27 23:07:23 +04:00
|
|
|
# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
|
2005-12-14 21:51:08 +03:00
|
|
|
# always in this variable even if NOTFOUND,
|
|
|
|
# all other INCLUDE_DIRS are
|
|
|
|
# only added if they are found.
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_INCLUDE_DIR Path to "include" of Qt4
|
2006-05-20 00:57:49 +04:00
|
|
|
# QT_QT_INCLUDE_DIR Path to "include/Qt"
|
|
|
|
# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
|
|
|
|
# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
|
|
|
|
# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
|
|
|
|
# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
|
|
|
|
# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
|
|
|
|
# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
|
|
|
|
# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
|
|
|
|
# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
|
|
|
|
# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
|
|
|
|
# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
|
|
|
|
# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
|
|
|
|
# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_LIBRARY_DIR Path to "lib" of Qt4
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2006-04-27 23:07:23 +04:00
|
|
|
# For every library of Qt there are three variables:
|
|
|
|
# QT_QTFOO_LIBRARY_RELEASE, which contains the full path to the release version
|
|
|
|
# QT_QTFOO_LIBRARY_DEBUG, which contains the full path to the debug version
|
|
|
|
# QT_QTFOO_LIBRARY, the full path to the release version if available, otherwise to the debug version
|
|
|
|
#
|
|
|
|
# So there are the following variables:
|
|
|
|
# The Qt3Support library: QT_QT3SUPPORT_LIBRARY
|
|
|
|
# QT_QT3SUPPORT_LIBRARY_RELEASE
|
|
|
|
# QT_QT3SUPPORT_DEBUG
|
|
|
|
#
|
|
|
|
# The QtAssistant library: QT_QTASSISTANT_LIBRARY
|
|
|
|
# QT_QTASSISTANT_LIBRARY_RELEASE
|
|
|
|
# QT_QTASSISTANT_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtCore library: QT_QTCORE_LIBRARY
|
|
|
|
# QT_QTCORE_LIBRARY_RELEASE
|
|
|
|
# QT_QTCORE_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtDesigner library: QT_QTDESIGNER_LIBRARY
|
|
|
|
# QT_QTDESIGNER_LIBRARY_RELEASE
|
|
|
|
# QT_QTDESIGNER_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtGui library: QT_QTGUI_LIBRARY
|
|
|
|
# QT_QTGUI_LIBRARY_RELEASE
|
|
|
|
# QT_QTGUI_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtMotif library: QT_QTMOTIF_LIBRARY
|
|
|
|
# QT_QTMOTIF_LIBRARY_RELEASE
|
|
|
|
# QT_QTMOTIF_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtNetwork library: QT_QTNETWORK_LIBRARY
|
|
|
|
# QT_QTNETWORK_LIBRARY_RELEASE
|
|
|
|
# QT_QTNETWORK_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtNsPLugin library: QT_QTNSPLUGIN_LIBRARY
|
|
|
|
# QT_QTNSPLUGIN_LIBRARY_RELEASE
|
|
|
|
# QT_QTNSPLUGIN_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtOpenGL library: QT_QTOPENGL_LIBRARY
|
|
|
|
# QT_QTOPENGL_LIBRARY_RELEASE
|
|
|
|
# QT_QTOPENGL_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtSql library: QT_QTSQL_LIBRARY
|
|
|
|
# QT_QTSQL_LIBRARY_RELEASE
|
|
|
|
# QT_QTSQL_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtXml library: QT_QTXML_LIBRARY
|
|
|
|
# QT_QTXML_LIBRARY_RELEASE
|
|
|
|
# QT_QTXML_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtSvg library: QT_QTSVG_LIBRARY
|
|
|
|
# QT_QTSVG_LIBRARY_RELEASE
|
|
|
|
# QT_QTSVG_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The QtTest library: QT_QTTEST_LIBRARY
|
|
|
|
# QT_QTTEST_LIBRARY_RELEASE
|
|
|
|
# QT_QTTEST_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
# The qtmain library for Windows QT_QTMAIN_LIBRARY
|
|
|
|
# QT_QTMAIN_LIBRARY_RELEASE
|
|
|
|
# QT_QTMAIN_LIBRARY_DEBUG
|
|
|
|
#
|
|
|
|
#The QtUiTools library: QT_QTUITOOLS_LIBRARY
|
|
|
|
# QT_QTUITOOLS_LIBRARY_RELEASE
|
|
|
|
# QT_QTUITOOLS_LIBRARY_DEBUG
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2006-04-27 23:07:23 +04:00
|
|
|
# also defined, but NOT for general use are
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_MOC_EXECUTABLE Where to find the moc tool.
|
|
|
|
# QT_UIC_EXECUTABLE Where to find the uic tool.
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_UIC3_EXECUTABLE Where to find the uic3 tool.
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_RCC_EXECUTABLE Where to find the rcc tool
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_DOC_DIR Path to "doc" of Qt4
|
|
|
|
# QT_MKSPECS_DIR Path to "mkspecs" of Qt4
|
|
|
|
#
|
|
|
|
#
|
2006-05-20 00:57:49 +04:00
|
|
|
# These are around for backwards compatibility
|
2005-07-15 20:14:47 +04:00
|
|
|
# they will be set
|
2005-12-15 22:17:43 +03:00
|
|
|
# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
|
|
|
|
# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
2005-07-15 20:14:47 +04:00
|
|
|
# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_MT_REQUIRED Qt4 is now always multithreaded
|
2006-05-20 00:57:49 +04:00
|
|
|
#
|
|
|
|
# These variables are set to "" Because Qt structure changed
|
2005-12-15 22:17:43 +03:00
|
|
|
# (They make no sense in Qt4)
|
2006-04-27 23:07:23 +04:00
|
|
|
# QT_QT_LIBRARY Qt-Library is now split
|
|
|
|
|
|
|
|
INCLUDE(CheckSymbolExists)
|
2006-06-16 22:45:47 +04:00
|
|
|
INCLUDE(MacroAddFileDependencies)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2005-09-08 17:58:41 +04:00
|
|
|
SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
|
|
|
|
|
|
|
|
SET( QT_DEFINITIONS "")
|
|
|
|
|
|
|
|
IF (WIN32)
|
|
|
|
SET(QT_DEFINITIONS -DQT_DLL)
|
|
|
|
ENDIF(WIN32)
|
2005-08-10 16:48:03 +04:00
|
|
|
|
|
|
|
# check for qmake
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake-qt4 PATHS
|
2005-09-10 05:51:23 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
|
2005-09-12 19:43:24 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
|
2005-09-12 17:00:55 +04:00
|
|
|
$ENV{QTDIR}/bin
|
2006-06-16 22:45:47 +04:00
|
|
|
)
|
2006-01-09 20:45:37 +03:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
|
|
|
|
|
|
|
|
|
|
|
|
IF (QT_QMAKE_EXECUTABLE)
|
|
|
|
|
2006-05-20 00:57:49 +04:00
|
|
|
SET(QT4_QMAKE_FOUND FALSE)
|
|
|
|
|
|
|
|
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
|
|
|
|
|
|
|
|
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
|
|
|
|
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
|
|
|
|
IF (qt_version_tmp)
|
|
|
|
|
|
|
|
# we need at least version 4.0.0
|
|
|
|
IF (NOT QT_MIN_VERSION)
|
|
|
|
SET(QT_MIN_VERSION "4.0.0")
|
|
|
|
ENDIF (NOT QT_MIN_VERSION)
|
|
|
|
|
|
|
|
#now parse the parts of the user given version string into variables
|
|
|
|
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
|
|
|
|
IF (NOT req_qt_major_vers)
|
|
|
|
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
|
|
|
|
ENDIF (NOT req_qt_major_vers)
|
|
|
|
|
|
|
|
# now parse the parts of the user given version string into variables
|
2006-06-16 22:45:47 +04:00
|
|
|
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
|
2006-05-20 00:57:49 +04:00
|
|
|
|
|
|
|
IF (NOT req_qt_major_vers EQUAL 4)
|
|
|
|
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
|
|
|
|
ENDIF (NOT req_qt_major_vers EQUAL 4)
|
|
|
|
|
|
|
|
# and now the version string given by qmake
|
2006-06-16 22:45:47 +04:00
|
|
|
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}")
|
2006-05-20 00:57:49 +04:00
|
|
|
|
|
|
|
# compute an overall version number which can be compared at once
|
|
|
|
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
|
|
|
|
MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
|
|
|
|
|
|
|
|
IF (found_vers LESS req_vers)
|
|
|
|
SET(QT4_QMAKE_FOUND FALSE)
|
|
|
|
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
|
|
|
|
ELSE (found_vers LESS req_vers)
|
|
|
|
SET(QT4_QMAKE_FOUND TRUE)
|
|
|
|
ENDIF (found_vers LESS req_vers)
|
|
|
|
|
|
|
|
ENDIF (qt_version_tmp)
|
2006-04-27 23:07:23 +04:00
|
|
|
|
|
|
|
ENDIF (QT_QMAKE_EXECUTABLE)
|
|
|
|
|
|
|
|
IF (QT4_QMAKE_FOUND)
|
|
|
|
|
|
|
|
# ask qmake for the library dir
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_LIBRARY_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
IF (NOT QT_LIBRARY_DIR)
|
2005-08-10 16:48:03 +04:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
2006-05-12 17:47:26 +04:00
|
|
|
ARGS "-query QT_INSTALL_LIBS"
|
|
|
|
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
|
2005-09-13 17:25:29 +04:00
|
|
|
IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2006-05-12 17:47:26 +04:00
|
|
|
SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
|
2005-09-13 17:25:29 +04:00
|
|
|
ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2006-05-12 17:47:26 +04:00
|
|
|
MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
|
2006-05-20 00:57:49 +04:00
|
|
|
MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
|
2005-09-13 17:25:29 +04:00
|
|
|
ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF(NOT QT_LIBRARY_DIR)
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
IF (APPLE)
|
|
|
|
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
|
|
|
SET(QT_USE_FRAMEWORKS ON
|
2006-05-12 17:47:26 +04:00
|
|
|
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
2005-09-12 17:00:55 +04:00
|
|
|
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
2006-05-12 17:47:26 +04:00
|
|
|
SET(QT_USE_FRAMEWORKS OFF
|
|
|
|
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
|
|
|
|
ENDIF (APPLE)
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# ask qmake for the binary dir
|
|
|
|
IF (NOT QT_BINARY_DIR)
|
2006-05-20 00:57:49 +04:00
|
|
|
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_BINS"
|
|
|
|
OUTPUT_VARIABLE qt_bins )
|
|
|
|
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "")
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF (NOT QT_BINARY_DIR)
|
|
|
|
|
|
|
|
# ask qmake for the include dir
|
|
|
|
IF (NOT QT_HEADERS_DIR)
|
2006-05-20 00:57:49 +04:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_HEADERS"
|
|
|
|
OUTPUT_VARIABLE qt_headers )
|
|
|
|
SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "")
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF(NOT QT_HEADERS_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
# ask qmake for the documentation directory
|
|
|
|
IF (NOT QT_DOC_DIR)
|
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_DOCS"
|
|
|
|
OUTPUT_VARIABLE qt_doc_dir )
|
|
|
|
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs")
|
|
|
|
ENDIF (NOT QT_DOC_DIR)
|
|
|
|
|
|
|
|
# ask qmake for the mkspecs directory
|
|
|
|
IF (NOT QT_MKSPECS_DIR)
|
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QMAKE_MKSPECS"
|
|
|
|
OUTPUT_VARIABLE qt_mkspecs_dir )
|
|
|
|
SET(QT_MKSPECS_DIR ${qt_mkspecs_dir} CACHE PATH "The location of the Qt mkspecs")
|
|
|
|
ENDIF (NOT QT_MKSPECS_DIR)
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Setting the INCLUDE-Variables
|
|
|
|
#
|
|
|
|
########################################
|
2006-04-27 23:07:23 +04:00
|
|
|
|
|
|
|
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtGlobal
|
|
|
|
${QT_HEADERS_DIR}/QtCore
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
2006-06-16 22:45:47 +04:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2006-04-27 23:07:23 +04:00
|
|
|
|
|
|
|
# Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
|
|
|
|
IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
2005-09-12 17:00:55 +04:00
|
|
|
IF (QT_USE_FRAMEWORKS)
|
|
|
|
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
|
|
|
|
ELSE (QT_USE_FRAMEWORKS)
|
2006-04-27 23:07:23 +04:00
|
|
|
STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
|
2005-09-12 17:00:55 +04:00
|
|
|
SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
|
|
|
|
ENDIF (QT_USE_FRAMEWORKS)
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
IF( NOT QT_INCLUDE_DIR)
|
2006-01-09 20:45:37 +03:00
|
|
|
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2006-04-27 23:07:23 +04:00
|
|
|
MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header")
|
2006-01-09 20:45:37 +03:00
|
|
|
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF( NOT QT_INCLUDE_DIR)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
#############################################
|
|
|
|
#
|
|
|
|
# Find out what window system we're using
|
|
|
|
#
|
|
|
|
#############################################
|
|
|
|
# Save required includes variable
|
|
|
|
SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
|
|
|
|
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
|
|
|
|
SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
|
|
|
|
# Check for Window system symbols (note: only one should end up being set)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
|
|
|
|
|
|
|
|
IF (QT_QTCOPY_REQUIRED)
|
2006-05-20 00:57:49 +04:00
|
|
|
CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
|
|
|
|
IF (NOT QT_IS_QTCOPY)
|
|
|
|
MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
|
|
|
|
ENDIF (NOT QT_IS_QTCOPY)
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF (QT_QTCOPY_REQUIRED)
|
|
|
|
|
|
|
|
# Restore CMAKE_REQUIRED_INCLUDES variable
|
|
|
|
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
|
|
|
|
#
|
|
|
|
#############################################
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
IF (QT_USE_FRAMEWORKS)
|
2006-04-27 23:07:23 +04:00
|
|
|
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -F${QT_LIBRARY_DIR} -L${QT_LIBRARY_DIR} )
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF (QT_USE_FRAMEWORKS)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QT3SUPPORT_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QT3SUPPORT_INCLUDE_DIR Qt3Support
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/Qt3Support
|
|
|
|
${QT_LIBRARY_DIR}/Qt3Support.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QT_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/Qt
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTGUI_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTGUI_INCLUDE_DIR QtGui
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtGui
|
|
|
|
${QT_LIBRARY_DIR}/QtGui.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set QT_QTSVG_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTSVG_INCLUDE_DIR QtSvg
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtSvg
|
|
|
|
${QT_LIBRARY_DIR}/QtSvg.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set QT_QTTEST_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTTEST_INCLUDE_DIR QtTest
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtTest
|
|
|
|
${QT_LIBRARY_DIR}/QtTest.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTUITOOLS_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTUITOOLS_INCLUDE_DIR QtTest
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtUiTools
|
|
|
|
${QT_LIBRARY_DIR}/QtUiTools.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTMOTIF_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
IF(Q_WS_X11)
|
|
|
|
FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif PATHS ${QT_INCLUDE_DIR}/QtMotif NO_DEFAULT_PATH )
|
|
|
|
ENDIF(Q_WS_X11)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTNETWORK_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTNETWORK_INCLUDE_DIR QtNetwork
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtNetwork
|
|
|
|
${QT_LIBRARY_DIR}/QtNetwork.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTNSPLUGIN_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtNsPlugin
|
|
|
|
${QT_LIBRARY_DIR}/QtNsPlugin.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTOPENGL_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTOPENGL_INCLUDE_DIR QtOpenGL
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtOpenGL
|
|
|
|
${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTSQL_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTSQL_INCLUDE_DIR QtSql
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtSql
|
|
|
|
${QT_LIBRARY_DIR}/QtSql.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTXML_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTXML_INCLUDE_DIR QtXml
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtXml
|
|
|
|
${QT_LIBRARY_DIR}/QtXml.framework/Headers
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTASSISTANT_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtAssistant
|
|
|
|
${QT_HEADERS_DIR}/QtAssistant
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_QTDESIGNER_INCLUDE_DIR
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PATH(QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents
|
|
|
|
PATHS
|
2005-09-12 17:00:55 +04:00
|
|
|
${QT_INCLUDE_DIR}/QtDesigner
|
|
|
|
${QT_HEADERS_DIR}/QtDesigner
|
2006-04-27 23:07:23 +04:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Make variables changeble to the advanced user
|
2006-04-27 23:07:23 +04:00
|
|
|
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# Set QT_INCLUDES
|
2006-04-27 23:07:23 +04:00
|
|
|
SET( QT_INCLUDES ${QT_INCLUDE_DIR} ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default )
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
|
|
|
|
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
|
2006-08-01 22:34:53 +04:00
|
|
|
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore_debug QtCored QtCored4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QT3SUPPORT_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Support_debug Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTGUI_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGui_debug QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTMOTIF_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
IF(Q_WS_X11)
|
|
|
|
FIND_LIBRARY(QT_QTMOTIF_LIBRARY_RELEASE NAMES QtMotif PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTMOTIF_LIBRARY_DEBUG NAMES QtMotif_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
ENDIF(Q_WS_X11)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTNETWORK_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetwork_debug QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTNSPLUGIN_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_RELEASE NAMES QtNsPlugin PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_DEBUG NAMES QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTOPENGL_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE NAMES QtOpenGL QtOpenGL4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGL_debug QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTSQL_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE NAMES QtSql QtSql4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSql_debug QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# Set QT_QTXML_LIBRARY
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE NAMES QtXml QtXml4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXml_debug QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-08-03 00:34:23 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTSVG_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE NAMES QtSvg QtSvg4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG NAMES QtSvg_debug QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTUITOOLS_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG NAMES QtUiTools_debug QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTTEST_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE NAMES QtTest QtTest4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG NAMES QtTest_debug QtTest_debug4 QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MARK_AS_ADVANCED(QT_QT3SUPPORT_LIBRARY QT_QTGUI_LIBRARY )
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-06-16 22:45:47 +04:00
|
|
|
IF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
|
|
|
|
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2006-08-01 23:24:46 +04:00
|
|
|
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
|
2006-06-16 22:45:47 +04:00
|
|
|
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
|
|
|
ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
|
2006-04-27 23:07:23 +04:00
|
|
|
|
|
|
|
# Set QT_QTASSISTANT_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd QtAssistantClient_debug QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
# Set QT_QTDESIGNER_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesigner_debug QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2006-04-27 23:14:25 +04:00
|
|
|
|
2006-08-01 17:12:18 +04:00
|
|
|
# Set QT_QTMAIN_LIBRARY
|
|
|
|
IF(WIN32)
|
|
|
|
FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain PATHS ${QT_LIBRARY_DIR}
|
|
|
|
NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmaind PATHS ${QT_LIBRARY_DIR}
|
|
|
|
NO_DEFAULT_PATH)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
############################################
|
|
|
|
#
|
|
|
|
# Check the existence of the libraries.
|
|
|
|
#
|
|
|
|
############################################
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MACRO (_QT4_ADJUST_LIB_VARS basename)
|
|
|
|
IF (QT_${basename}_INCLUDE_DIR)
|
|
|
|
|
|
|
|
# if only the release version was found, set the debug variable also to the release version
|
|
|
|
IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
|
|
|
|
SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
|
|
|
|
|
|
|
|
# if only the debug version was found, set the release variable also to the debug version
|
|
|
|
IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
|
|
|
|
SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
|
|
|
|
IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
|
2006-08-01 20:27:53 +04:00
|
|
|
# if the generator supports configuration types then set
|
|
|
|
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
|
|
|
|
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
2006-06-16 22:45:47 +04:00
|
|
|
SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
|
2006-08-01 20:27:53 +04:00
|
|
|
ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
|
|
|
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
|
|
|
|
# then just use the release libraries
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
|
|
|
|
ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
2006-04-27 23:07:23 +04:00
|
|
|
SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
|
|
|
|
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library")
|
|
|
|
|
|
|
|
IF (QT_${basename}_LIBRARY)
|
|
|
|
SET(QT_${basename}_FOUND 1)
|
|
|
|
ENDIF (QT_${basename}_LIBRARY)
|
|
|
|
|
|
|
|
#add the include directory to QT_INCLUDES
|
|
|
|
SET(QT_INCLUDES ${QT_INCLUDES} "${QT_${basename}_INCLUDE_DIR}")
|
|
|
|
ENDIF (QT_${basename}_INCLUDE_DIR )
|
|
|
|
|
|
|
|
# Make variables changeble to the advanced user
|
|
|
|
MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
|
|
|
|
ENDMACRO (_QT4_ADJUST_LIB_VARS)
|
|
|
|
|
|
|
|
IF(WIN32)
|
2006-08-01 23:48:44 +04:00
|
|
|
# there is no include for qtmain but adjust macro needs it set
|
|
|
|
SET(QT_QTMAIN_INCLUDE_DIR 1)
|
2006-05-20 00:57:49 +04:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTMAIN)
|
2006-08-01 23:48:44 +04:00
|
|
|
SET(QT_QTMAIN_INCLUDE_DIR )
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTCORE)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTGUI)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QT3SUPPORT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTASSISTANT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTDESIGNER)
|
|
|
|
IF(Q_WS_X11)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTMOTIF)
|
|
|
|
ENDIF(Q_WS_X11)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTNETWORK)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTNSPLUGIN)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTOPENGL)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTSQL)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTXML)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTSVG)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTUITOOLS)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTTEST)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2006-05-20 00:57:49 +04:00
|
|
|
# Check the executables of Qt
|
2005-09-12 17:00:55 +04:00
|
|
|
# ( moc, uic, rcc )
|
|
|
|
#
|
|
|
|
#######################################
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-05-20 00:57:49 +04:00
|
|
|
# find moc and uic using qmake
|
2006-06-14 20:28:32 +04:00
|
|
|
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
|
2006-05-12 18:56:12 +04:00
|
|
|
"message(MOC<$$QMAKE_MOC>)
|
|
|
|
message(UIC<$$QMAKE_UIC>)
|
2006-04-27 23:07:23 +04:00
|
|
|
")
|
2006-05-12 17:47:26 +04:00
|
|
|
|
2006-05-20 00:57:49 +04:00
|
|
|
EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
|
2006-06-14 20:28:32 +04:00
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
|
2006-05-20 00:57:49 +04:00
|
|
|
OUTPUT_VARIABLE _moc_OUTPUT
|
|
|
|
ERROR_VARIABLE _moc_OUTPUT )
|
2006-06-14 20:28:32 +04:00
|
|
|
FILE(REMOVE_RECURSE
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
|
|
|
|
|
|
|
|
STRING(REGEX REPLACE
|
|
|
|
".*MOC<([^>]+).*" "\\1" QT_MOC_EXECUTABLE_INTERNAL "${_moc_OUTPUT}" )
|
|
|
|
STRING(REGEX REPLACE
|
|
|
|
".*UIC<([^>]+).*" "\\1" QT_UIC_EXECUTABLE_INTERNAL "${_moc_OUTPUT}" )
|
|
|
|
|
|
|
|
FILE(TO_CMAKE_PATH
|
|
|
|
"${QT_MOC_EXECUTABLE_INTERNAL}" QT_MOC_EXECUTABLE_INTERNAL)
|
|
|
|
FILE(TO_CMAKE_PATH
|
|
|
|
"${QT_UIC_EXECUTABLE_INTERNAL}" QT_UIC_EXECUTABLE_INTERNAL)
|
|
|
|
|
|
|
|
SET(QT_MOC_EXECUTABLE
|
|
|
|
${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable")
|
|
|
|
SET(QT_UIC_EXECUTABLE
|
|
|
|
${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable")
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
FIND_PROGRAM(QT_UIC3_EXECUTABLE
|
|
|
|
NAMES uic3
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2006-05-20 00:57:49 +04:00
|
|
|
FIND_PROGRAM(QT_RCC_EXECUTABLE
|
2005-09-12 17:00:55 +04:00
|
|
|
NAMES rcc
|
2006-04-27 23:07:23 +04:00
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 17:00:55 +04:00
|
|
|
)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
IF (QT_MOC_EXECUTABLE)
|
|
|
|
SET(QT_WRAP_CPP "YES")
|
|
|
|
ENDIF (QT_MOC_EXECUTABLE)
|
|
|
|
|
|
|
|
IF (QT_UIC_EXECUTABLE)
|
|
|
|
SET(QT_WRAP_UI "YES")
|
|
|
|
ENDIF (QT_UIC_EXECUTABLE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE )
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
######################################
|
|
|
|
#
|
|
|
|
# Macros for building Qt files
|
|
|
|
#
|
|
|
|
######################################
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
|
|
|
|
SET(${_moc_INC_DIRS})
|
|
|
|
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
|
|
|
|
|
|
|
|
FOREACH(_current ${_inc_DIRS})
|
|
|
|
SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-I" ${_current})
|
|
|
|
ENDFOREACH(_current ${_inc_DIRS})
|
|
|
|
ENDMACRO(QT4_GET_MOC_INC_DIRS)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO (QT4_GENERATE_MOC infile outfile )
|
|
|
|
# get include dirs
|
|
|
|
QT4_GET_MOC_INC_DIRS(moc_includes)
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(infile ${infile} ABSOLUTE)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${moc_includes} -o ${outfile} ${infile}
|
|
|
|
DEPENDS ${infile})
|
2006-06-16 22:45:47 +04:00
|
|
|
|
|
|
|
MACRO_ADD_FILE_DEPENDENCIES(${infile} ${outfile})
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDMACRO (QT4_GENERATE_MOC)
|
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
# QT4_WRAP_CPP(outfiles inputfile ... )
|
|
|
|
# TODO perhaps add support for -D, -U and other minor options
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MACRO (QT4_WRAP_CPP outfiles )
|
2005-09-12 17:00:55 +04:00
|
|
|
# get include dirs
|
2006-04-27 23:07:23 +04:00
|
|
|
QT4_GET_MOC_INC_DIRS(moc_includes)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
FOREACH (it ${ARGN})
|
|
|
|
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
|
2005-09-12 17:00:55 +04:00
|
|
|
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
|
|
|
|
|
|
|
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
2006-04-27 23:07:23 +04:00
|
|
|
ARGS ${moc_includes} -o ${outfile} ${it}
|
|
|
|
DEPENDS ${it})
|
2005-09-12 17:00:55 +04:00
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
|
|
|
ENDFOREACH(it)
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDMACRO (QT4_WRAP_CPP)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
|
|
|
|
# QT4_WRAP_UI(outfiles inputfile ... )
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MACRO (QT4_WRAP_UI outfiles )
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
FOREACH (it ${ARGN})
|
2005-09-12 17:00:55 +04:00
|
|
|
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
2006-05-11 18:41:42 +04:00
|
|
|
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
2005-09-12 17:00:55 +04:00
|
|
|
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_UIC_EXECUTABLE}
|
|
|
|
ARGS -o ${outfile} ${infile}
|
|
|
|
MAIN_DEPENDENCY ${infile})
|
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDFOREACH (it)
|
|
|
|
|
|
|
|
ENDMACRO (QT4_WRAP_UI)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
|
|
|
|
# QT4_ADD_RESOURCE(outfiles inputfile ... )
|
|
|
|
# TODO perhaps consider adding support for compression and root options to rcc
|
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
MACRO (QT4_ADD_RESOURCES outfiles )
|
2005-09-12 17:00:55 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
FOREACH (it ${ARGN})
|
2005-09-12 17:00:55 +04:00
|
|
|
GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
2006-05-11 18:41:42 +04:00
|
|
|
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
2005-09-12 17:00:55 +04:00
|
|
|
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_RCC_EXECUTABLE}
|
|
|
|
ARGS -name ${outfilename} -o ${outfile} ${infile}
|
|
|
|
MAIN_DEPENDENCY ${infile} )
|
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDFOREACH (it)
|
|
|
|
|
|
|
|
ENDMACRO (QT4_ADD_RESOURCES)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(QT4_AUTOMOC)
|
|
|
|
QT4_GET_MOC_INC_DIRS(_moc_INCS)
|
|
|
|
|
|
|
|
SET(_matching_FILES )
|
|
|
|
FOREACH (_current_FILE ${ARGN})
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
|
|
|
|
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
|
|
|
|
# here. this is required to make bouic work correctly:
|
|
|
|
# we need to add generated .cpp files to the sources (to compile them),
|
|
|
|
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
|
|
|
|
# cmake is run for the very first time on them -> however the .cpp files might
|
|
|
|
# exist at a later run. at that time we need to skip them, so that we don't add two
|
|
|
|
# different rules for the same moc file
|
|
|
|
GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
|
|
|
|
|
|
|
|
IF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
|
|
|
|
|
|
FILE(READ ${_abs_FILE} _contents)
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
|
|
|
|
|
|
|
|
STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
|
|
|
|
IF(_match)
|
|
|
|
FOREACH (_current_MOC_INC ${_match})
|
|
|
|
STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
|
|
|
|
|
|
|
|
GET_filename_component(_basename ${_current_MOC} NAME_WE)
|
|
|
|
# SET(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
|
|
|
|
SET(_header ${_abs_PATH}/${_basename}.h)
|
|
|
|
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
|
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${_moc_INCS} ${_header} -o ${_moc}
|
|
|
|
DEPENDS ${_header}
|
|
|
|
)
|
|
|
|
|
2006-06-16 22:45:47 +04:00
|
|
|
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDFOREACH (_current_MOC_INC)
|
|
|
|
ENDIF(_match)
|
|
|
|
ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
|
|
ENDFOREACH (_current_FILE)
|
|
|
|
ENDMACRO(QT4_AUTOMOC)
|
2005-09-12 17:00:55 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################
|
|
|
|
#
|
2006-01-09 20:45:37 +03:00
|
|
|
# decide if Qt got found
|
2005-09-12 17:00:55 +04:00
|
|
|
#
|
|
|
|
######################################
|
2006-04-27 23:07:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
# if the includes,libraries,moc,uic and rcc are found then we have it
|
|
|
|
IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET( QT4_FOUND "YES" )
|
2006-01-09 20:45:37 +03:00
|
|
|
IF( NOT Qt4_FIND_QUIETLY)
|
2006-02-08 17:51:18 +03:00
|
|
|
MESSAGE(STATUS "Found Qt-Version ${QTVERSION}")
|
2006-01-09 20:45:37 +03:00
|
|
|
ENDIF( NOT Qt4_FIND_QUIETLY)
|
2005-09-12 17:00:55 +04:00
|
|
|
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET( QT4_FOUND "NO")
|
2006-01-09 20:45:37 +03:00
|
|
|
IF( Qt4_FIND_REQUIRED)
|
2006-01-25 20:16:49 +03:00
|
|
|
MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
|
2006-01-09 20:45:37 +03:00
|
|
|
ENDIF( Qt4_FIND_REQUIRED)
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET(QT_FOUND ${QT4_FOUND})
|
|
|
|
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2006-05-20 00:57:49 +04:00
|
|
|
# System dependent settings
|
2005-09-12 17:00:55 +04:00
|
|
|
#
|
|
|
|
#######################################
|
|
|
|
# for unix add X11 stuff
|
|
|
|
IF(UNIX)
|
2006-04-27 23:07:23 +04:00
|
|
|
# on OS X X11 may not be required
|
|
|
|
IF (Q_WS_X11)
|
2006-05-20 00:57:49 +04:00
|
|
|
FIND_PACKAGE(X11)
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF (Q_WS_X11)
|
|
|
|
FIND_PACKAGE(Threads)
|
|
|
|
SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
2005-09-12 17:00:55 +04:00
|
|
|
ENDIF(UNIX)
|
|
|
|
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2006-05-20 00:57:49 +04:00
|
|
|
# compatibility settings
|
2005-09-12 17:00:55 +04:00
|
|
|
#
|
|
|
|
#######################################
|
|
|
|
# Backwards compatibility for CMake1.4 and 1.2
|
|
|
|
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
|
|
|
|
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
|
|
|
|
|
|
|
|
SET( QT_QT_LIBRARY "")
|
2006-04-27 23:07:23 +04:00
|
|
|
|
2005-09-12 17:00:55 +04:00
|
|
|
ELSE(QT4_QMAKE_FOUND)
|
2006-04-27 23:07:23 +04:00
|
|
|
|
|
|
|
IF(Qt4_FIND_REQUIRED)
|
|
|
|
IF(QT4_INSTALLED_VERSION_TOO_OLD)
|
|
|
|
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
|
|
|
|
ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
|
2006-05-20 00:57:49 +04:00
|
|
|
MESSAGE( FATAL_ERROR "Qt qmake not found!")
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
|
|
|
|
ELSE(Qt4_FIND_REQUIRED)
|
|
|
|
IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
|
|
|
|
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
|
|
|
|
ENDIF(Qt4_FIND_REQUIRED)
|
2006-05-20 00:57:49 +04:00
|
|
|
|
2006-04-27 23:07:23 +04:00
|
|
|
ENDIF (QT4_QMAKE_FOUND)
|
|
|
|
|