Perform check for tool builds before src

Perform the test whether tools should be built before entering the
source directory of a project. In QtDeclarative this would result in
a configuration error since the tools are used while building everything
under src.

Change-Id: I33ce2cb317ef221836d696654f3bb4e39db47e54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-08-07 10:23:28 +02:00
parent ebe77c89de
commit 2c7ccfefed

View File

@ -76,13 +76,14 @@ macro(qt_build_repo)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test)
endif()
## Decide whether tools will be built.
qt_check_if_tools_will_be_built()
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt")
add_subdirectory(src)
endif()
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt")
## Decide whether tools will be built.
qt_check_if_tools_will_be_built()
add_subdirectory(tools)
endif()