summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-05-21 09:04:27 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-05-21 08:05:44 +0000
commitd61ca95fc09531479e3d9343bf55d77065844c28 (patch)
treeb60035bf4351c87969b5d20b60a7736775adcb0d /cmake
parenta859cb508ce7152c107acd251b45c3213659903c (diff)
Simplify top-level CMakeLists.txt for modules
Implement some aspects of qt_parts.prf to simplify the top-level CMakeLists.txt for repositories that follow the common qt structure (src, tools, tests, examples). Change-Id: Ia35f4e9207e92c1cf0406353561b0cc52dcb0e59 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 34e40365ca..767a9dc45f 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -53,3 +53,23 @@ macro(qt_build_repo_end)
RUNTIME_PACKAGES_NOT_FOUND
FATAL_ON_MISSING_REQUIRED_PACKAGES)
endmacro()
+
+macro(qt_build_repo)
+ qt_build_repo_begin(${ARGN})
+
+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src")
+ add_subdirectory(src)
+ endif()
+
+ if (BUILD_TESTING)
+ find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test Xml)
+ add_subdirectory(tests)
+ endif()
+
+ if (BUILD_EXAMPLES)
+ # TODO: Implement me
+ #add_subdirectory(examples)
+ endif()
+
+ qt_build_repo_end()
+endmacro()