2011-11-01 13:59:23 +00:00
|
|
|
|
|
|
|
defineReplace(cmakeModuleName) {
|
|
|
|
_module = $$1
|
|
|
|
_name = $$eval(QT.$${_module}.name)
|
|
|
|
cmake_module_name = $$replace(_name, ^Qt, )
|
|
|
|
return ($$cmake_module_name)
|
|
|
|
}
|
|
|
|
|
|
|
|
defineReplace(cmakeModuleList) {
|
|
|
|
variable = $$1
|
|
|
|
out =
|
|
|
|
for(v, variable) {
|
|
|
|
out += $$cmakeModuleName($$v)
|
|
|
|
}
|
|
|
|
return ($$join(out, ";"))
|
|
|
|
}
|
|
|
|
|
|
|
|
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
|
|
|
|
|
2012-04-27 14:17:22 +00:00
|
|
|
CMAKE_MODULE_DEPS = $$cmakeModuleList($$eval(QT.$${MODULE}.depends))
|
|
|
|
CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
|
|
|
|
!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
|
|
|
|
|
2012-02-27 15:45:27 +00:00
|
|
|
CMAKE_QT_INSTALL_PREFIX = $$replace($$list($$[QT_INSTALL_PREFIX]), \\\\, /)/
|
|
|
|
CMAKE_QT_INSTALL_PREFIX_ESCAPED = "^$$re_escape($$CMAKE_QT_INSTALL_PREFIX)"
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-29 16:00:04 +00:00
|
|
|
CMAKE_INCLUDE_DIR = $$replace($$list($$[QT_INSTALL_HEADERS]), \\\\, /)/
|
2012-02-27 15:45:27 +00:00
|
|
|
contains(CMAKE_INCLUDE_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
|
|
|
|
CMAKE_INCLUDE_DIR = $$replace(CMAKE_INCLUDE_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
|
|
|
|
} else {
|
|
|
|
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
|
|
|
CMAKE_LIB_DIR = $$replace($$list($$[QT_INSTALL_LIBS]), \\\\, /)/
|
|
|
|
contains(CMAKE_LIB_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
|
|
|
|
CMAKE_LIB_DIR = $$replace(CMAKE_LIB_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
|
|
|
|
CMAKE_RELATIVE_INSTALL_DIR = $$replace(CMAKE_LIB_DIR, "[^/]+", ..)
|
|
|
|
# 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}../../"
|
|
|
|
} else {
|
|
|
|
CMAKE_LIB_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
|
|
|
CMAKE_BIN_DIR = $$replace($$list($$[QT_INSTALL_BINS]), \\\\, /)/
|
|
|
|
contains(CMAKE_BIN_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
|
|
|
|
CMAKE_BIN_DIR = $$replace(CMAKE_BIN_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
|
|
|
|
} else {
|
|
|
|
CMAKE_BIN_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
|
|
|
CMAKE_DATA_DIR = $$replace($$list($$[QT_INSTALL_DATA]), \\\\, /)/ # For the mkspecs
|
|
|
|
contains(CMAKE_DATA_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
|
|
|
|
CMAKE_DATA_DIR = $$replace(CMAKE_DATA_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
|
|
|
|
} else {
|
|
|
|
CMAKE_DATA_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-02 21:40:30 +00:00
|
|
|
static|staticlib:CMAKE_STATIC_TYPE = true
|
|
|
|
|
2012-02-07 18:07:49 +00:00
|
|
|
contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"
|
|
|
|
|
2011-11-01 13:59:23 +00:00
|
|
|
macx {
|
|
|
|
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"
|
|
|
|
} else {
|
2012-02-02 21:40:30 +00:00
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2011-12-16 23:47:13 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
|
|
|
|
} else {
|
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.$$eval(QT.$${MODULE}.VERSION).dylib
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.$$eval(QT.$${MODULE}.VERSION).dylib
|
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
} else:win32 {
|
2012-02-23 17:25:28 +00:00
|
|
|
CMAKE_WINDOWS_BUILD = "true"
|
2011-12-12 11:57:17 +00:00
|
|
|
CMAKE_BIN_SUFFIX = ".exe"
|
2012-02-23 16:05:41 +00:00
|
|
|
|
2012-02-23 17:25:28 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
|
|
|
|
|
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) {
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
|
|
|
|
} else {
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).a
|
|
|
|
}
|
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) {
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.lib
|
|
|
|
} else {
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
|
|
|
|
}
|
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) {
|
2011-12-16 23:47:13 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
|
|
|
|
} else {
|
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.so.$$eval(QT.$${MODULE}.VERSION)
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.so.$$eval(QT.$${MODULE}.VERSION)
|
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 04:37:31 +00:00
|
|
|
CMAKE_DEBUG_TYPE =
|
|
|
|
CMAKE_RELEASE_TYPE =
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-04-23 19:55:14 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
if (build_all|CONFIG(debug, debug|release)):CMAKE_DEBUG_TYPE = debug
|
|
|
|
if (build_all|CONFIG(release, debug|release)):CMAKE_RELEASE_TYPE = release
|
2011-11-01 13:59:23 +00:00
|
|
|
|
|
|
|
INSTALLS += cmake_qt5_module_files
|
|
|
|
|
|
|
|
cmake_config_file.input = $$PWD/../cmake/Qt5BasicConfig.cmake.in
|
|
|
|
cmake_config_file.output = $$eval(QT.$${MODULE}.libs)/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake
|
|
|
|
|
|
|
|
cmake_config_version_file.input = $$PWD/../cmake/Qt5ConfigVersion.cmake.in
|
|
|
|
cmake_config_version_file.output = $$eval(QT.$${MODULE}.libs)/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
|
|
|
|
|
|
|
|
QMAKE_SUBSTITUTES += \
|
|
|
|
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"
|
|
|
|
cmake_extras_file.output = $$eval(QT.$${MODULE}.libs)/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
|
|
|
|
|
|
|
|
QMAKE_SUBSTITUTES += cmake_extras_file
|
|
|
|
|
|
|
|
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-02-11 10:45:32 +00:00
|
|
|
cmake_macros_file.output = $$eval(QT.$${MODULE}.libs)/cmake/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
|
|
|
|
cmake_macros_file.config = verbatim
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-11 10:45:32 +00:00
|
|
|
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}
|