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

message(STATUS "Entered subdir_with_local_qt subdirectory")

set(file_path "${CMAKE_CURRENT_BINARY_DIR}/lib.cpp")
file(GENERATE OUTPUT "${file_path}" CONTENT "int foo() { return 42; }")
add_library(lib_local_qt STATIC "${file_path}")

# These Qt targets will be local to this directory scope.
find_package(Qt6 REQUIRED COMPONENTS Gui)

target_link_libraries(lib_local_qt PRIVATE Qt6::Gui)

message(STATUS "Exiting subdir_with_local_qt subdirectory")