Warning, /frameworks/extra-cmake-modules/tests/ECMQmlModuleTest/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # 0002 # SPDX-FileCopyrightText: 2021 Arjen Hiemstra <ahiemstra@heimr.nl> 0003 # 0004 # SPDX-License-Identifier: BSD-3-Clause 0005 0006 cmake_minimum_required(VERSION 3.5) 0007 project(extra-cmake-modules) 0008 0009 set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) 0010 set(CMAKE_MODULE_PATH "${ECM_FIND_MODULE_DIR}" "${ECM_MODULE_DIR}") 0011 include(QtVersionOption) 0012 0013 find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Qml) 0014 include(ECMQmlModule) 0015 0016 set(CMAKE_AUTOMOC ON) 0017 0018 if(QML_ONLY) 0019 ecm_add_qml_module(TestModule URI Test NO_PLUGIN) 0020 else() 0021 if (QT_MAJOR_VERSION LESS 6 OR NOT DEPENDS) 0022 ecm_add_qml_module(TestModule URI Test) 0023 else () 0024 ecm_add_qml_module(TestModule URI Test DEPENDENCIES OtherTest) 0025 endif() 0026 target_sources(TestModule PRIVATE qmlmodule.cpp) 0027 target_link_libraries(TestModule PRIVATE Qt${QT_MAJOR_VERSION}::Qml) 0028 endif() 0029 0030 if (QT_MAJOR_VERSION LESS 6 AND DEPENDS) 0031 ecm_add_qml_module_dependencies(TestModule DEPENDS OtherTest) 0032 endif() 0033 0034 ecm_target_qml_sources(TestModule SOURCES QmlModule.qml) 0035 ecm_target_qml_sources(TestModule VERSION 2.0 SOURCES QmlModule2.qml) 0036 0037 ecm_finalize_qml_module(TestModule DESTINATION "test") 0038 0039 # this will be run by CTest 0040 if (BUILD_SHARED_LIBS) 0041 get_target_property(MODULE_OUTPUT_PATH TestModule LIBRARY_OUTPUT_DIRECTORY) 0042 else() 0043 get_target_property(MODULE_OUTPUT_PATH TestModule ARCHIVE_OUTPUT_DIRECTORY) 0044 endif() 0045 configure_file(check.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check.cmake" @ONLY)