diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-10-19 13:35:15 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-11-20 20:38:03 +0100 |
commit | fb21a5ce1a5831fab2af5e4d301600d6a6211e5d (patch) | |
tree | b4fdb21ea8c58c352c26383505f958b1a6ac9967 /cmake/QtBuildInternals | |
parent | 47778847ec103242ee95b01d502272d6a9879e9b (diff) |
CMake: Name QT_NO_MAKE_*/BUILD_* variables consistently
For consistency, apply the following renamings:
QT_NO_MAKE_EXAMPLES -> QT_BUILD_EXAMPLES_BY_DEFAULT
QT_NO_MAKE_TESTS -> QT_BUILD_TESTS_BY_DEFAULT
QT_NO_MAKE_TOOLS -> QT_BUILD_TOOLS_BY_DEFAULT
BUILD_EXAMPLES -> QT_BUILD_EXAMPLES
BUILD_TESTING -> QT_BUILD_TESTS
This should help to better convey the difference between "BUILD" and
"NO_MAKE".
To configure tests, but not to build them by default, pass the
following to CMake:
-DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF
Analoguous for examples:
-DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF
Tools can be excluded from the default build with:
-DBUILD_TOOLS_BY_DEFAULT=OFF
The variable BUILD_TESTING is still available and initialized with the
value of QT_BUILD_TESTS.
Pick-to: 6.0 6.0.0
Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuildInternals')
-rw-r--r-- | cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index a7b86ed606..5216cebf66 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -372,7 +372,7 @@ macro(qt_build_repo) # If testing is enabled, try to find the qtbase Test package. # Do this before adding src, because there might be test related conditions # in source. - if (BUILD_TESTING AND NOT QT_BUILD_STANDALONE_TESTS) + if (QT_BUILD_TESTS AND NOT QT_BUILD_STANDALONE_TESTS) find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test) endif() @@ -386,20 +386,20 @@ macro(qt_build_repo) endif() endif() - if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") + if (QT_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") add_subdirectory(tests) - if(QT_NO_MAKE_TESTS) + if(NOT QT_BUILD_TESTS_BY_DEFAULT) set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE) endif() endif() qt_build_repo_end() - if (BUILD_EXAMPLES AND BUILD_SHARED_LIBS + if(QT_BUILD_EXAMPLES AND BUILD_SHARED_LIBS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt" AND NOT QT_BUILD_STANDALONE_TESTS) add_subdirectory(examples) - if(QT_NO_MAKE_EXAMPLES) + if(NOT QT_BUILD_EXAMPLES_BY_DEFAULT) set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE) endif() endif() |