summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-08 14:45:41 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-05-15 11:31:31 +0000
commit02a015375a639a4d27d19bbf435f20b725696768 (patch)
tree6efe36f0290cbe7d5eb4c44f847974c1bd44f645 /qmake
parent6396d46f554e6eab2ba7f212bd7447961cd4c286 (diff)
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run make install. To do a non-prefix build, pass -DFEATURE_developer_build=ON when invoking CMake on qtbase. Note that this of course also enables developer build features (private tests, etc). When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable will point to the qtbase build directory. Tests can be run without installing Qt (QPA plugins are picked up from the build dir). This patch stops installation of any files by forcing the make "install" target be a no-op. When invoking cmake on the qtsvg module (or any other module), the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build directory. The developer-build feature is propagated via the QtCore Config file, so that when building other modules, you don't have to specify it on the command line again. As a result of the change, all libraries, plugins, tools, include dirs, CMake Config files, CMake Targets files, Macro files, etc, will be placed in the qtbase build directory, mimicking the file layout of an installed Qt file layout. Only examples and tests are kept in the separate module build directories, which is equivalent to how qmake does it. The following global variables contain paths for the appropriate prefix or non prefix builds: QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR, QT_CONFIG_INSTALL_DIR. These should be used by developers when deciding where files should be placed. All usages of install() are replaced by qt_install(), which has some additional logic on how to handle associationg of CMake targets to export names. When installing files, some consideration should be taken if qt_copy_or_install() needs to be used instead of qt_install(), which takes care of copying files from the source dir to the build dir when doing non-prefix builds. Tested with qtbase and qtsvg, developer builds, non-developer builds and static developer builds on Windows, Linux and macOS. Task-number: QTBUG-75581 Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt
index 49d622a5fe..a1e7625650 100644
--- a/qmake/CMakeLists.txt
+++ b/qmake/CMakeLists.txt
@@ -1,7 +1,12 @@
# Generated from qmake.pro.
-# special case:
-install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR})
+# special case begin
+set(path_component "${INSTALL_DATADIR}")
+qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${path_component})
+
+qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs"
+ DESTINATION ${mkspecs_install_dir})
+# special case end
find_library(FWApplicationServices ApplicationServices) # special case
find_library(FWCoreServices CoreServices) # special case