diff options
Diffstat (limited to 'tests/auto/cmake')
4 files changed, 58 insertions, 1 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 46dcdcca2b..b2639f5e0b 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -51,9 +51,11 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.9) # Requires INCLUDE_DIRECTORIES target property in CMake 2.8.8 # and POSITION_INDEPENDENT_CODE target property in 2.8.9 expect_pass(test_use_modules_function) + expect_pass(test_umbrella_config) else() - message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\"") + message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\" or \"test_umbrella_config\"") endif() + expect_pass(test_wrap_cpp_and_resources) expect_pass(test_dependent_modules) expect_fail(test_add_resource_options) diff --git a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt new file mode 100644 index 0000000000..a8fc2b53ed --- /dev/null +++ b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt @@ -0,0 +1,20 @@ + +cmake_minimum_required(VERSION 2.8) + +project(test_umbrella_config) + +add_subdirectory(components_found) + +if (Qt5_FOUND) + message(SEND_ERROR "Qt5_FOUND variable leaked!") +endif() + +if (Qt5Core_FOUND) + message(SEND_ERROR "Qt5Core_FOUND variable leaked!") +endif() + +if (TARGET Qt5::Core) + message(SEND_ERROR "Qt5::Core target leaked!") +endif() + +add_subdirectory(components_not_found) diff --git a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt new file mode 100644 index 0000000000..91cb623deb --- /dev/null +++ b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt @@ -0,0 +1,18 @@ + +# The module finds its dependencies +find_package(Qt5 + COMPONENTS Core + OPTIONAL_COMPONENTS DoesNotExist +) + +if (NOT Qt5_FOUND) + message(SEND_ERROR "Qt5 umbrella package not found!") +endif() + +if (NOT Qt5Core_FOUND) + message(SEND_ERROR "Qt5Core package not found!") +endif() + +if (Qt5DoesNotExist_FOUND) + message(SEND_ERROR "Non-existent package found!") +endif() diff --git a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt new file mode 100644 index 0000000000..424c3e3445 --- /dev/null +++ b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt @@ -0,0 +1,17 @@ + +# The module finds its dependencies +find_package(Qt5 + COMPONENTS Core DoesNotExist +) + +if (Qt5_FOUND) + message(SEND_ERROR "Qt5 umbrella package found, though it should not be!") +endif() + +if (NOT Qt5Core_FOUND) + message(SEND_ERROR "Qt5Core package not found!") +endif() + +if (Qt5DoesNotExist_FOUND) + message(SEND_ERROR "Non-existent package found!") +endif() |