From 4cd9ac52ed470bd9072a29efe12e3e1b1dfb6a4b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2020 13:35:15 +0200 Subject: 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. Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080 Reviewed-by: Alexandru Croitor (cherry picked from commit fb21a5ce1a5831fab2af5e4d301600d6a6211e5d) Reviewed-by: Qt Cherry-pick Bot --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f36c73b14e..53daa1721a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,9 +96,9 @@ if(NOT QT_BUILD_STANDALONE_TESTS) add_subdirectory(src) endif() -if(BUILD_TESTING) +if(QT_BUILD_TESTS) 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() @@ -129,9 +129,9 @@ endif() qt_build_repo_end() -if(NOT QT_BUILD_STANDALONE_TESTS AND BUILD_EXAMPLES) +if(NOT QT_BUILD_STANDALONE_TESTS AND QT_BUILD_EXAMPLES) 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() -- cgit v1.2.3