qt5base-lts/cmake/QtBuildInternalsExtra.cmake.in
Alexandru Croitor 021c17c62f Add support for -nomake-tests and -nomake-examples equivalents
A developer can pass either -DQT_NO_MAKE_TESTS=ON or
-DQT_NO_MAKE_EXAMPLES=ON to exclude tests or examples from being built
as part the default make target (when you write just make or ninja).

With ninja, tests and examples can be built separately one by one,
by typing
 $ ninja tst_foo
or
 $ ninja example_bar

Same can be done with the Makefile generator.
 $ make tst_foo

All tests / examples can be built in one go by typing
 $ ninja tests/all
or
 $ ninja examples/all

With the Makefile generator unfortunately it's not as nice and is most
likely an implementation detail, but it can still be done by running
something like
 $ make -f CMakeFiles/Makefile2 tests/all
or
 $ make -f CMakeFiles/Makefile2 examples/all

Change-Id: I34f168b3ab41e952a21d3ace5634e25a9f41922e
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-08 16:05:44 +00:00

36 lines
1.7 KiB
CMake

# Propagate common variables via BuildInternals package.
set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" @BUILD_SHARED_LIBS@)
set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@)
set(INSTALL_CMAKE_NAMESPACE @INSTALL_CMAKE_NAMESPACE@)
set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
set(QT_BUILD_INTERNALS_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Propagate the original install prefix, so that a developer building a child module can
# specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX.
set(CMAKE_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@ CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
# Propagate developer builds to other modules via BuildInternals package.
if(@FEATURE_developer_build@)
set(FEATURE_developer_build ON CACHE BOOL "Developer build." FORCE)
endif()
# Propagate non-prefix builds.
set(QT_WILL_INSTALL @QT_WILL_INSTALL@ CACHE BOOL
"Boolean indicating if doing a Qt prefix build (vs non-prefix build)." FORCE)
set(QT_SOURCE_TREE "@QT_SOURCE_TREE@" CACHE PATH
"A path to the source tree of the previously configured QtBase project." FORCE)
# Propagate decision of building tests and examples to other repositories.
set(BUILD_TESTING @BUILD_TESTING@ CACHE BOOL "Build the testing tree.")
set(BUILD_EXAMPLES @BUILD_EXAMPLES@ CACHE BOOL "Build Qt examples")
set(QT_NO_MAKE_TESTS @QT_NO_MAKE_TESTS@ CACHE BOOL
"Should tests be built as part of the default 'all' target.")
set(QT_NO_MAKE_EXAMPLES @QT_NO_MAKE_EXAMPLES@ CACHE BOOL
"Should examples be built as part of the default 'all' target.")
# Extra set of exported variables
@QT_EXTRA_BUILD_INTERNALS_VARS@