summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt
blob: 1bb6ab41ad01e607abc930553018f7fefbab97a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0


cmake_minimum_required(VERSION 3.16)

project(test_wrap_cpp_options)

if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
    include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
endif()

find_package(Qt6Core REQUIRED HINTS ${Qt6Tests_PREFIX_PATH})

# Test options. The -i option removes the include "myobject.h" from the moc file
# causing a compile failure. -> Options work
qt_wrap_cpp(moc_files myobject.h OPTIONS -i)

add_executable(myobject myobject.cpp ${moc_files})
target_link_libraries(myobject PRIVATE Qt::Core)