2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2013-02-25 14:42:06 +00:00
|
|
|
load(cmake_functions)
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2013-02-11 12:59:34 +00:00
|
|
|
# Several distros (ArchLinux, Fedora) have in the past installed libraries
|
|
|
|
# in /lib(64)?, but are now moving to install libraries in /usr/lib(64)?/.
|
|
|
|
# The /lib paths are made symlinks to the /usr/lib paths. If someone searching
|
|
|
|
# for a Qt 5 package finds it in /lib/cmake/Qt5Core, although it has been
|
|
|
|
# installed in /usr/lib/cmake/Qt5Core, relative paths to the includes and
|
2013-04-17 12:55:36 +00:00
|
|
|
# executables will not work.
|
|
|
|
# To work around this, we insert code into the generated config files to check
|
|
|
|
# at cmake time whether package has been found via a symlink, and correct
|
|
|
|
# that to an absolute path. This is only done for installations to
|
|
|
|
# the /usr or / prefix.
|
|
|
|
CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
|
|
|
|
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
|
2013-02-11 12:59:34 +00:00
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
|
2012-02-27 15:45:27 +00:00
|
|
|
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
2013-05-14 12:32:44 +00:00
|
|
|
!exists($$first(QT.$${MODULE}.private_includes)): CMAKE_NO_PRIVATE_INCLUDES = true
|
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
|
|
|
|
CMAKE_LIB_DIR_IS_ABSOLUTE = True
|
|
|
|
} else {
|
|
|
|
CMAKE_RELATIVE_INSTALL_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
|
2012-02-27 15:45:27 +00:00
|
|
|
# We need to go up another two levels because the CMake files are
|
|
|
|
# installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
|
|
|
|
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_DIR}../../"
|
|
|
|
}
|
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
|
2012-02-27 15:45:27 +00:00
|
|
|
CMAKE_BIN_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
2013-06-12 12:57:11 +00:00
|
|
|
!isEmpty(DLLDESTDIR):!static:!staticlib {
|
|
|
|
CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
|
|
|
|
contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
|
|
|
|
CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
|
|
|
|
CMAKE_DLL_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
|
|
|
|
CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
|
|
|
|
}
|
|
|
|
|
2013-04-08 11:44:21 +00:00
|
|
|
CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") {
|
2013-04-08 11:44:21 +00:00
|
|
|
CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/
|
|
|
|
CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = True
|
2012-02-27 15:45:27 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-02 21:40:30 +00:00
|
|
|
static|staticlib:CMAKE_STATIC_TYPE = true
|
|
|
|
|
2013-08-19 09:31:50 +00:00
|
|
|
CMAKE_DEBUG_TYPE =
|
|
|
|
CMAKE_RELEASE_TYPE =
|
|
|
|
|
|
|
|
# Requirements:
|
|
|
|
# * If Qt is configured with -debug, we're creating debug libraries and not
|
|
|
|
# release libraries, regardless of whether we're on a platform where
|
|
|
|
# debug_and_release is true.
|
|
|
|
# * If Qt is configured with -release, we're creating release libraries and not
|
|
|
|
# debug libraries, regardless of whether we're on a platform where
|
|
|
|
# debug_and_release is true.
|
|
|
|
# * If Qt is configured with neither -debug nor -release, and we are on a
|
|
|
|
# platform where debug_and_release is true, we're creating both
|
|
|
|
# debug and release libraries.
|
|
|
|
# * If Qt is configured with -debug on a platform where debug_and_release is
|
|
|
|
# true, and 'make release' is subsequently invoked, CMake is only aware of
|
|
|
|
# the debug libraries at build time.
|
|
|
|
|
|
|
|
equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
|
|
|
|
if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
|
|
|
|
if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
|
|
|
|
|
2012-12-07 09:15:36 +00:00
|
|
|
unix:contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"
|
2012-02-07 18:07:49 +00:00
|
|
|
|
2012-10-29 14:16:51 +00:00
|
|
|
CMAKE_MKSPEC = $$[QMAKE_XSPEC]
|
2012-10-15 15:15:41 +00:00
|
|
|
|
2013-08-19 09:31:50 +00:00
|
|
|
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
|
|
|
|
|
|
|
|
CMAKE_MODULE_DEPS = $$cmakeModuleList($$sort_depends(QT.$${MODULE}.depends, QT.))
|
|
|
|
CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
|
|
|
|
!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
|
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_QT_STEM = Qt$$eval(QT.$${MODULE}.MAJOR_VERSION)$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
|
|
|
|
|
2013-03-02 14:46:37 +00:00
|
|
|
mac {
|
2012-07-20 10:39:09 +00:00
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-08-21 11:12:57 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2011-11-01 13:59:23 +00:00
|
|
|
} else {
|
2012-07-20 10:39:09 +00:00
|
|
|
CONFIG(qt_framework, qt_framework|qt_no_framework) {
|
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.framework/Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.framework/Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
|
|
|
|
CMAKE_BUILD_IS_FRAMEWORK = "true"
|
2011-12-16 23:47:13 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.$$eval(QT.$${MODULE}.VERSION).dylib
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
|
2011-12-16 23:47:13 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
} else:win32 {
|
2012-02-23 17:25:28 +00:00
|
|
|
CMAKE_WINDOWS_BUILD = "true"
|
2012-06-24 17:36:27 +00:00
|
|
|
CMAKE_FIND_OTHER_LIBRARY_BUILD = "true"
|
2012-02-23 16:05:41 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll
|
2012-02-23 17:25:28 +00:00
|
|
|
|
2012-02-23 16:05:41 +00:00
|
|
|
win32-g++ {
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
|
2012-02-23 17:25:28 +00:00
|
|
|
|
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-09-25 07:44:25 +00:00
|
|
|
CMAKE_STATIC_WINDOWS_BUILD = "true"
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-09-25 08:35:59 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2012-02-23 17:25:28 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-02-23 17:25:28 +00:00
|
|
|
}
|
2012-02-23 16:05:41 +00:00
|
|
|
} else {
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
|
2012-02-23 17:25:28 +00:00
|
|
|
|
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-09-25 07:44:25 +00:00
|
|
|
CMAKE_STATIC_WINDOWS_BUILD = "true"
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
|
2012-08-21 11:12:57 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
|
2012-02-23 17:25:28 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
|
2012-02-23 17:25:28 +00:00
|
|
|
}
|
2012-02-23 16:05:41 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
} else {
|
2012-02-02 21:40:30 +00:00
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2011-12-16 23:47:13 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)
|
|
|
|
CMAKE_LIB_SONAME = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.MAJOR_VERSION)
|
2011-12-16 23:47:13 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTALLS += cmake_qt5_module_files
|
|
|
|
|
2012-12-06 15:29:21 +00:00
|
|
|
cmake_config_file.input = $$PWD/data/cmake/Qt5BasicConfig.cmake.in
|
2012-06-23 14:31:48 +00:00
|
|
|
cmake_config_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-10-17 14:04:03 +00:00
|
|
|
CMAKE_PACKAGE_VERSION = $$eval(QT.$${MODULE}.VERSION)
|
|
|
|
|
2012-12-06 15:29:21 +00:00
|
|
|
cmake_config_version_file.input = $$PWD/data/cmake/Qt5ConfigVersion.cmake.in
|
2012-06-23 14:31:48 +00:00
|
|
|
cmake_config_version_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += \
|
2011-11-01 13:59:23 +00:00
|
|
|
cmake_config_file \
|
|
|
|
cmake_config_version_file
|
|
|
|
|
|
|
|
cmake_qt5_module_files.files = \
|
|
|
|
$$cmake_config_file.output \
|
|
|
|
$$cmake_config_version_file.output
|
|
|
|
|
|
|
|
cmake_extras_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake.in
|
|
|
|
exists($$cmake_extras_file.input) {
|
|
|
|
|
|
|
|
CMAKE_MODULE_EXTRAS = "true"
|
2012-06-23 14:31:48 +00:00
|
|
|
cmake_extras_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += cmake_extras_file
|
2011-11-01 13:59:23 +00:00
|
|
|
|
|
|
|
cmake_qt5_module_files.files += \
|
|
|
|
$$cmake_extras_file.output
|
|
|
|
}
|
|
|
|
|
2012-02-11 10:45:32 +00:00
|
|
|
cmake_macros_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
|
|
|
|
exists($$cmake_macros_file.input) {
|
2011-11-01 13:59:23 +00:00
|
|
|
CMAKE_MODULE_MACROS = "true"
|
|
|
|
|
2012-06-23 14:31:48 +00:00
|
|
|
cmake_macros_file.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
|
2012-07-03 20:29:45 +00:00
|
|
|
cmake_macros_file.CONFIG = verbatim
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += cmake_macros_file
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-11 10:45:32 +00:00
|
|
|
cmake_qt5_module_files.files += $$cmake_macros_file.output
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
|