diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-14 12:05:49 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-14 14:34:15 +0100 |
commit | 4114011fd9924fde653dab6250e73a6b4c2b7941 (patch) | |
tree | 8a42fb881e86ec5af9ff69387b1b6b52a3f368bc | |
parent | 8e97daa0caedf3b6306de30c5bd113a64e4792e5 (diff) |
CMake: Use qtbase helpers for building the repo
The qtdoc repo need to build the various doc subdirectories instead of
the src subdirectory, so when it was initially ported to CMake, it
didn't use qt_build_repo() like all the other repos, and instead copy
pasted the various pieces of qt_build_repo().
Now that qtbase exposes these as separate functions, we can use them
instead. This mimics the structure qt_build_repo except for the
doc-specific parts.
This also fixes being able to build examples for static builds due to
removing the BUILD_SHARED_LIBS condition, which is not present anymore
in qtbase's qt_build_repo_impl_examples.
Pick-to: 6.7
Change-Id: I0d203b53e785225d594528a5709c65f408e32704
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 35adf5a38..4a7b3a27c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,8 @@ find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG ) qt_internal_project_setup() -# special case begin qt_build_repo_begin() +qt_build_repo_impl_find_package_tests() if(NOT QT_BUILD_STANDALONE_TESTS) add_subdirectory(doc) @@ -58,24 +58,6 @@ if(NOT QT_BUILD_STANDALONE_TESTS) endif() qt_build_repo_post_process() - -if(QT_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") - add_subdirectory(tests) - - if(NOT QT_BUILD_TESTS_BY_DEFAULT) - set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE) - endif() -endif() - -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(NOT QT_BUILD_EXAMPLES_BY_DEFAULT) - set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE) - endif() -endif() - +qt_build_repo_impl_tests() qt_build_repo_end() -# special case end +qt_build_repo_impl_examples() |