aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorArjen Hiemstra <ahiemstra@heimr.nl>2021-08-02 15:01:13 +0200
committerArjen Hiemstra <ahiemstra@heimr.nl>2022-01-18 12:09:57 +0000
commit3813fd1bc97fa6bb2189cc9586f77be4c30478d6 (patch)
treea579dccf4ba1e0bccc58da42c3c39a97a569303b /tests/CMakeLists.txt
parentf4049c5429afc3e195a60984922b7cb7276d908f (diff)
downloadextra-cmake-modules-3813fd1bc97fa6bb2189cc9586f77be4c30478d6.tar.gz
extra-cmake-modules-3813fd1bc97fa6bb2189cc9586f77be4c30478d6.tar.bz2
Introduce ECMQmlModule.cmake
This contains some helper functions to make it easier to create QML modules through CMake. It takes care of several things that currently need to be done manually. It adds four tests for the four primary ways that it can be used, either as shared/static library and with or without C++ plugin.
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b2143ec9..7ffcfd03 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -209,6 +209,50 @@ set_package_properties(
)
if (TARGET Qt5::Quick)
add_test_macro(ECMQMLModules dummy)
+
+ set(ECMQmlModuleTest.static_full_EXTRA_OPTIONS
+ --build-target install
+ --build-options -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/static_full/install
+ -DBUILD_SHARED_LIBS=OFF
+ )
+ add_test_variant(ECMQmlModuleTest.static_full ECMQmlModuleTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/static_full/check.cmake"
+ )
+ set(ECMQmlModuleTest.shared_full_EXTRA_OPTIONS
+ --build-target install
+ --build-options -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_full/install
+ -DBUILD_SHARED_LIBS=ON
+ )
+ add_test_variant(ECMQmlModuleTest.shared_full ECMQmlModuleTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_full/check.cmake"
+ )
+ set(ECMQmlModuleTest.static_qmlonly_EXTRA_OPTIONS
+ --build-target install
+ --build-options -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/static_qmlonly/install
+ -DBUILD_SHARED_LIBS=OFF
+ -DQML_ONLY=ON
+ )
+ add_test_variant(ECMQmlModuleTest.static_qmlonly ECMQmlModuleTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/static_qmlonly/check.cmake"
+ )
+ set(ECMQmlModuleTest.shared_qmlonly_EXTRA_OPTIONS
+ --build-target install
+ --build-options -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_qmlonly/install
+ -DBUILD_SHARED_LIBS=ON
+ -DQML_ONLY=ON
+ )
+ add_test_variant(ECMQmlModuleTest.shared_qmlonly ECMQmlModuleTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_qmlonly/check.cmake"
+ )
+ set(ECMQmlModuleTest.shared_depends_EXTRA_OPTIONS
+ --build-target install
+ --build-options -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_depends/install
+ -DBUILD_SHARED_LIBS=ON
+ -DDEPENDS=ON
+ )
+ add_test_variant(ECMQmlModuleTest.shared_depends ECMQmlModuleTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMQmlModuleTest/shared_depends/check.cmake"
+ )
endif()
set(ECMConfiguredInstallTest_EXTRA_OPTIONS