2005-12-14 21:51:08 +03:00
|
|
|
# - Locate Qt include paths and libraries
|
2005-12-15 17:19:23 +03:00
|
|
|
# This module defines:
|
|
|
|
# QT_INCLUDE_DIR - where to find qt.h, etc.
|
|
|
|
# QT_LIBRARIES - the libraries to link against to use Qt.
|
2006-08-27 21:59:18 +04:00
|
|
|
# QT_DEFINITIONS - definitions to use when
|
2005-12-15 17:19:23 +03:00
|
|
|
# compiling code that uses Qt.
|
|
|
|
# QT_FOUND - If false, don't try to use Qt.
|
|
|
|
#
|
|
|
|
# If you need the multithreaded version of Qt, set QT_MT_REQUIRED to TRUE
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
# QT_QT_LIBRARY, where to find the Qt library.
|
2006-08-27 21:59:18 +04:00
|
|
|
# QT_QTMAIN_LIBRARY, where to find the qtmain
|
2005-12-15 17:19:23 +03:00
|
|
|
# library. This is only required by Qt3 on Windows.
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2006-08-27 21:59:18 +04:00
|
|
|
# These are around for backwards compatibility
|
2005-07-15 20:14:47 +04:00
|
|
|
# they will be set
|
2005-12-14 21:51:08 +03:00
|
|
|
# QT_WRAP_CPP, set true if QT_MOC_EXECUTABLE is found
|
|
|
|
# QT_WRAP_UI set true if QT_UIC_EXECUTABLE is found
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2009-09-28 19:45:50 +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:45:50 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2008-08-17 03:11:53 +04:00
|
|
|
# If Qt4 has already been found, fail.
|
|
|
|
IF(QT4_FOUND)
|
|
|
|
IF(Qt3_FIND_REQUIRED)
|
|
|
|
MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
|
|
|
|
ELSE(Qt3_FIND_REQUIRED)
|
|
|
|
IF(NOT Qt3_FIND_QUIETLY)
|
|
|
|
MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.")
|
|
|
|
ENDIF(NOT Qt3_FIND_QUIETLY)
|
|
|
|
RETURN()
|
|
|
|
ENDIF(Qt3_FIND_REQUIRED)
|
|
|
|
ENDIF(QT4_FOUND)
|
|
|
|
|
|
|
|
|
2005-09-12 17:32:21 +04:00
|
|
|
FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/)
|
2005-07-15 20:14:47 +04:00
|
|
|
FIND_PATH(QT_INCLUDE_DIR qt.h
|
2005-09-10 05:51:23 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
|
2005-07-15 20:14:47 +04:00
|
|
|
$ENV{QTDIR}/include
|
2005-09-12 17:32:21 +04:00
|
|
|
${GLOB_PATHS_BIN}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/include
|
|
|
|
/usr/lib/qt/include
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/include
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/include/qt
|
|
|
|
/usr/share/qt3/include
|
|
|
|
C:/Progra~1/qt/include
|
|
|
|
/usr/include/qt3
|
|
|
|
)
|
|
|
|
|
2006-03-06 22:08:15 +03:00
|
|
|
# if qglobal.h is not in the qt_include_dir then set
|
|
|
|
# QT_INCLUDE_DIR to NOTFOUND
|
|
|
|
IF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
|
2008-08-17 03:11:53 +04:00
|
|
|
SET(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
|
2006-03-06 22:08:15 +03:00
|
|
|
ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
|
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
IF(QT_INCLUDE_DIR)
|
|
|
|
#extract the version string from qglobal.h
|
|
|
|
FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
|
|
|
|
STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"([0-9]+.[0-9]+.[0-9]+)\"" QGLOBAL_H "${QGLOBAL_H}")
|
2006-04-23 15:23:57 +04:00
|
|
|
STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
|
2005-07-15 20:14:47 +04:00
|
|
|
|
|
|
|
# Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
|
|
|
|
# version X.Y.Z, so we need to remove the dots from version
|
2006-04-23 15:23:57 +04:00
|
|
|
STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
|
2005-07-15 20:14:47 +04:00
|
|
|
ENDIF(QT_INCLUDE_DIR)
|
|
|
|
|
2005-09-12 17:32:21 +04:00
|
|
|
FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
|
2005-07-15 20:14:47 +04:00
|
|
|
IF (QT_MT_REQUIRED)
|
|
|
|
FIND_LIBRARY(QT_QT_LIBRARY
|
2005-09-12 18:28:48 +04:00
|
|
|
NAMES
|
|
|
|
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
|
2006-08-27 21:59:18 +04:00
|
|
|
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
|
2005-07-15 20:14:47 +04:00
|
|
|
PATHS
|
2005-09-10 05:51:23 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
|
2005-07-15 20:14:47 +04:00
|
|
|
$ENV{QTDIR}/lib
|
2005-09-12 17:32:21 +04:00
|
|
|
${GLOB_PATHS_LIB}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/lib
|
|
|
|
/usr/lib/qt/lib
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/lib
|
|
|
|
/usr/lib/qt3/lib64
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/share/qt3/lib
|
|
|
|
C:/Progra~1/qt/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
ELSE (QT_MT_REQUIRED)
|
|
|
|
FIND_LIBRARY(QT_QT_LIBRARY
|
2006-08-27 21:59:18 +04:00
|
|
|
NAMES
|
|
|
|
qt qt-${qt_version_str_lib} qt-edu${qt_version_str_lib}
|
2005-09-12 18:28:48 +04:00
|
|
|
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
|
2006-08-27 21:59:18 +04:00
|
|
|
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
|
2005-07-15 20:14:47 +04:00
|
|
|
PATHS
|
2005-09-12 17:32:21 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
|
2005-07-15 20:14:47 +04:00
|
|
|
$ENV{QTDIR}/lib
|
2005-09-12 17:32:21 +04:00
|
|
|
${GLOB_PATHS_LIB}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/lib
|
|
|
|
/usr/lib/qt/lib
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/lib
|
|
|
|
/usr/lib/qt3/lib64
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/share/qt3/lib
|
|
|
|
C:/Progra~1/qt/lib
|
|
|
|
)
|
|
|
|
ENDIF (QT_MT_REQUIRED)
|
|
|
|
|
|
|
|
|
|
|
|
FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
|
|
|
|
NAMES qassistantclient
|
|
|
|
PATHS
|
2005-09-12 17:32:21 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
|
2005-07-15 20:14:47 +04:00
|
|
|
$ENV{QTDIR}/lib
|
2005-09-12 17:32:21 +04:00
|
|
|
${GLOB_PATHS_LIB}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/lib
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/lib
|
|
|
|
/usr/lib/qt3/lib64
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/share/qt3/lib
|
|
|
|
C:/Progra~1/qt/lib
|
|
|
|
)
|
|
|
|
|
2006-05-07 21:04:57 +04:00
|
|
|
# qt 3 should prefer QTDIR over the PATH
|
2006-08-27 21:59:18 +04:00
|
|
|
FIND_PROGRAM(QT_MOC_EXECUTABLE
|
2009-10-05 18:25:36 +04:00
|
|
|
NAMES moc-qt3 moc
|
2008-06-10 00:04:06 +04:00
|
|
|
HINTS
|
2006-08-27 21:59:18 +04:00
|
|
|
$ENV{QTDIR}/bin
|
|
|
|
PATHS
|
2005-09-12 17:32:21 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
|
2006-08-27 21:59:18 +04:00
|
|
|
$ENV{QTDIR}/bin
|
2005-09-12 17:32:21 +04:00
|
|
|
${GLOB_PATHS_BIN}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/bin
|
|
|
|
/usr/lib/qt/bin
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/bin
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/share/qt3/bin
|
|
|
|
C:/Progra~1/qt/bin
|
|
|
|
/usr/X11R6/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
IF(QT_MOC_EXECUTABLE)
|
|
|
|
SET ( QT_WRAP_CPP "YES")
|
|
|
|
ENDIF(QT_MOC_EXECUTABLE)
|
|
|
|
|
2006-05-07 21:04:57 +04:00
|
|
|
# qt 3 should prefer QTDIR over the PATH
|
2009-10-05 18:25:36 +04:00
|
|
|
FIND_PROGRAM(QT_UIC_EXECUTABLE
|
|
|
|
NAMES uic-qt3 uic
|
2008-06-10 00:04:06 +04:00
|
|
|
HINTS
|
2006-08-27 21:59:18 +04:00
|
|
|
$ENV{QTDIR}/bin
|
2008-06-10 00:04:06 +04:00
|
|
|
PATHS
|
2005-09-12 17:32:21 +04:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
|
|
|
|
${GLOB_PATHS_BIN}
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/local/qt/bin
|
|
|
|
/usr/lib/qt/bin
|
2006-08-30 21:51:22 +04:00
|
|
|
/usr/lib/qt3/bin
|
2005-07-15 20:14:47 +04:00
|
|
|
/usr/share/qt3/bin
|
|
|
|
C:/Progra~1/qt/bin
|
|
|
|
/usr/X11R6/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
IF(QT_UIC_EXECUTABLE)
|
|
|
|
SET ( QT_WRAP_UI "YES")
|
|
|
|
ENDIF(QT_UIC_EXECUTABLE)
|
|
|
|
|
|
|
|
IF (WIN32)
|
|
|
|
FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain
|
2012-02-21 00:02:11 +04:00
|
|
|
HINTS
|
|
|
|
$ENV{QTDIR}/lib
|
2006-02-28 18:27:30 +03:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
|
2012-02-21 00:02:11 +04:00
|
|
|
PATHS
|
2006-02-28 18:27:30 +03:00
|
|
|
"$ENV{ProgramFiles}/qt/lib"
|
2012-02-21 00:02:11 +04:00
|
|
|
"C:/Program Files/qt/lib"
|
2005-07-15 20:14:47 +04:00
|
|
|
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
|
|
|
|
)
|
|
|
|
ENDIF (WIN32)
|
|
|
|
|
|
|
|
|
|
|
|
IF (QT_MIN_VERSION)
|
|
|
|
|
|
|
|
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" qt_major_vers "${qt_version_str}")
|
|
|
|
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" qt_minor_vers "${qt_version_str}")
|
|
|
|
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" qt_patch_vers "${qt_version_str}")
|
2006-08-27 21:59:18 +04:00
|
|
|
|
|
|
|
#now parse the parts of the user given version string into variables
|
2005-07-15 20:14:47 +04:00
|
|
|
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" req_qt_major_vers "${QT_MIN_VERSION}")
|
|
|
|
IF (NOT req_qt_major_vers)
|
2008-06-18 16:37:32 +04:00
|
|
|
error_message( "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"")
|
2005-07-15 20:14:47 +04:00
|
|
|
ENDIF (NOT req_qt_major_vers)
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14: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-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
# req = "6.5.4", qt = "3.2.1"
|
2008-08-17 01:14:01 +04:00
|
|
|
MACRO(error_message msg)
|
2008-06-18 16:37:32 +04:00
|
|
|
IF(QT3_REQUIRED)
|
|
|
|
MESSAGE( FATAL_ERROR ${msg})
|
|
|
|
ELSE(QT3_REQUIRED)
|
|
|
|
MESSAGE( STATUS ${msg})
|
|
|
|
ENDIF(QT3_REQUIRED)
|
2008-08-17 01:14:01 +04:00
|
|
|
ENDMACRO(error_message)
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ?
|
2008-08-17 01:14:01 +04:00
|
|
|
ERROR_MESSAGE( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
|
2005-07-15 20:14:47 +04:00
|
|
|
ELSE (req_qt_major_vers GREATER qt_major_vers) # no
|
|
|
|
IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ?
|
|
|
|
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
|
|
|
|
ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ?
|
|
|
|
IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ?
|
2008-08-17 01:14:01 +04:00
|
|
|
ERROR_MESSAGE( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
|
2005-07-15 20:14:47 +04:00
|
|
|
ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no
|
|
|
|
IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ?
|
|
|
|
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
|
|
|
|
ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2)
|
|
|
|
IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
|
2008-08-17 01:14:01 +04:00
|
|
|
ERROR_MESSAGE( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
|
2005-07-15 20:14:47 +04:00
|
|
|
ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
|
|
|
|
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
|
|
|
|
ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
|
|
|
|
ENDIF (req_qt_minor_vers LESS qt_minor_vers)
|
|
|
|
ENDIF (req_qt_minor_vers GREATER qt_minor_vers)
|
|
|
|
ENDIF (req_qt_major_vers LESS qt_major_vers)
|
|
|
|
ENDIF (req_qt_major_vers GREATER qt_major_vers)
|
|
|
|
ENDIF (QT_MIN_VERSION)
|
|
|
|
|
|
|
|
# if the include a library are found then we have it
|
Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake. It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18). However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).
Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module. Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.
Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line
include(FindPackageHandleStandardArgs)
loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.
Whether this breakage can be considered a backward incompatible change
in CMake is debatable. The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header. Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.
This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them. At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.
In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17). That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy. However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.
We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line. Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.
The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28). This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 18:56:49 +03:00
|
|
|
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
2010-11-09 23:51:59 +03:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE)
|
|
|
|
SET(QT_FOUND ${QT3_FOUND} )
|
2005-07-15 20:14:47 +04:00
|
|
|
|
|
|
|
IF(QT_FOUND)
|
|
|
|
SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
|
|
|
|
SET( QT_DEFINITIONS "")
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
IF (WIN32 AND NOT CYGWIN)
|
|
|
|
IF (QT_QTMAIN_LIBRARY)
|
|
|
|
# for version 3
|
2005-11-22 19:33:46 +03:00
|
|
|
SET (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
|
2005-07-15 20:14:47 +04:00
|
|
|
SET (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
|
|
|
|
SET (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
|
|
|
|
ELSE (QT_QTMAIN_LIBRARY)
|
|
|
|
# for version 2
|
|
|
|
SET (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
|
|
|
|
ENDIF (QT_QTMAIN_LIBRARY)
|
|
|
|
ELSE (WIN32 AND NOT CYGWIN)
|
|
|
|
SET (QT_LIBRARIES ${QT_QT_LIBRARY} )
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-11-22 19:33:46 +03:00
|
|
|
SET (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
|
2005-07-15 20:14:47 +04:00
|
|
|
IF(QT_QT_LIBRARY MATCHES "qt-mt")
|
|
|
|
SET (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
|
|
|
|
ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
ENDIF (WIN32 AND NOT CYGWIN)
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
IF (QT_QASSISTANTCLIENT_LIBRARY)
|
|
|
|
SET (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
|
|
|
|
ENDIF (QT_QASSISTANTCLIENT_LIBRARY)
|
2006-08-27 21:59:18 +04:00
|
|
|
|
2005-07-15 20:14:47 +04:00
|
|
|
# Backwards compatibility for CMake1.4 and 1.2
|
|
|
|
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
|
|
|
|
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
|
|
|
|
# for unix add X11 stuff
|
|
|
|
IF(UNIX)
|
|
|
|
FIND_PACKAGE(X11)
|
|
|
|
IF (X11_FOUND)
|
|
|
|
SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
|
|
|
|
ENDIF (X11_FOUND)
|
|
|
|
IF (CMAKE_DL_LIBS)
|
|
|
|
SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
|
|
|
|
ENDIF (CMAKE_DL_LIBS)
|
|
|
|
ENDIF(UNIX)
|
|
|
|
IF(QT_QT_LIBRARY MATCHES "qt-mt")
|
|
|
|
FIND_PACKAGE(Threads)
|
|
|
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
|
|
|
|
ENDIF(QT_FOUND)
|
|
|
|
|
2006-11-22 21:30:59 +03:00
|
|
|
EXEC_PROGRAM(${QT_MOC_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE QTVERSION_MOC)
|
2007-06-11 23:02:03 +04:00
|
|
|
EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE QTVERSION_UIC)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2006-11-22 21:30:59 +03:00
|
|
|
SET(_QT_UIC_VERSION_3 FALSE)
|
|
|
|
IF("${QTVERSION_UIC}" MATCHES ".* 3..*")
|
|
|
|
SET(_QT_UIC_VERSION_3 TRUE)
|
|
|
|
ENDIF("${QTVERSION_UIC}" MATCHES ".* 3..*")
|
|
|
|
|
|
|
|
SET(_QT_MOC_VERSION_3 FALSE)
|
|
|
|
IF("${QTVERSION_MOC}" MATCHES ".* 3..*")
|
|
|
|
SET(_QT_MOC_VERSION_3 TRUE)
|
|
|
|
ENDIF("${QTVERSION_MOC}" MATCHES ".* 3..*")
|
|
|
|
|
|
|
|
SET(QT_WRAP_CPP FALSE)
|
2008-08-17 01:14:01 +04:00
|
|
|
IF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
|
|
|
|
SET ( QT_WRAP_CPP TRUE)
|
|
|
|
ENDIF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
2006-11-22 21:30:59 +03:00
|
|
|
SET(QT_WRAP_UI FALSE)
|
2008-08-17 01:14:01 +04:00
|
|
|
IF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
|
|
|
|
SET ( QT_WRAP_UI TRUE)
|
|
|
|
ENDIF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
|
2005-07-15 20:14:47 +04:00
|
|
|
|
|
|
|
MARK_AS_ADVANCED(
|
|
|
|
QT_INCLUDE_DIR
|
|
|
|
QT_QT_LIBRARY
|
|
|
|
QT_QTMAIN_LIBRARY
|
|
|
|
QT_QASSISTANTCLIENT_LIBRARY
|
|
|
|
QT_UIC_EXECUTABLE
|
|
|
|
QT_MOC_EXECUTABLE
|
|
|
|
QT_WRAP_CPP
|
|
|
|
QT_WRAP_UI
|
2006-08-27 21:59:18 +04:00
|
|
|
)
|