Imported Upstream version 3.21.4
[platform/upstream/cmake.git] / Tests / RunCMake / Autogen / CMP0111-imported-target-prelude.cmake
1 enable_language(CXX)
2
3 find_package(Qt5 REQUIRED COMPONENTS Core)
4
5 # Detect `-NOTFOUND` libraries at generate time.
6 cmake_policy(SET CMP0111 NEW)
7
8 add_executable(imported::executable IMPORTED)
9 add_library(imported::shared SHARED IMPORTED)
10 add_library(imported::static STATIC IMPORTED)
11 add_library(imported::unknown UNKNOWN IMPORTED)
12 add_library(imported::interface INTERFACE IMPORTED)
13 add_library(imported::module MODULE IMPORTED)
14
15 function (set_location target name loc)
16   set_property(TARGET "imported::${target}" PROPERTY
17     "IMPORTED_${name}" "${loc}")
18 endfunction ()
19
20 set(CMAKE_AUTOMOC 1)
21
22 add_library(automoc
23   empty.cpp)
24 target_link_libraries(automoc
25   PRIVATE
26     imported::shared
27     imported::static
28     imported::unknown
29     imported::interface)
30 add_dependencies(automoc
31   imported::executable
32   imported::module)