3 add_compile_definitions(TEST_ADD_COMPILE_DEFINITIONS)
5 set_property(SOURCE a.h PROPERTY LANGUAGE C)
6 set_property(SOURCE dir/c.h PROPERTY LANGUAGE C)
7 set_property(SOURCE dir/cxx.h PROPERTY LANGUAGE CXX)
9 add_library(static STATIC lib.c)
10 target_sources(static INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
12 add_library(shared SHARED lib.c)
13 target_sources(shared INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
15 add_library(object OBJECT lib.c)
16 target_sources(object INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
18 add_library(interface INTERFACE)
19 target_sources(interface INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
21 add_executable(exe main.c)
22 target_sources(exe INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
24 add_executable(export_exe main.c)
25 set_property(TARGET export_exe PROPERTY ENABLE_EXPORTS TRUE)
26 target_sources(export_exe INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
28 add_library(none STATIC lib.c)
30 add_library(property_off STATIC lib.c)
31 target_sources(property_off INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
32 set_property(TARGET property_off PROPERTY VERIFY_INTERFACE_HEADER_SETS OFF)
34 add_library(private STATIC lib.c)
35 target_sources(private PRIVATE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
37 add_library(a_h STATIC lib.c)
38 target_compile_definitions(a_h INTERFACE TEST_A_H)
39 target_sources(a_h INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
41 add_library(dir_c_h STATIC lib.c)
42 target_compile_definitions(dir_c_h INTERFACE TEST_DIR_C_H)
43 target_sources(dir_c_h INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
45 add_library(dir_cxx_h STATIC lib.c)
46 target_compile_definitions(dir_cxx_h INTERFACE TEST_DIR_CXX_H)
47 target_sources(dir_cxx_h INTERFACE FILE_SET HEADERS FILES a.h dir/c.h dir/cxx.h)
49 set_property(SOURCE debug.h PROPERTY LANGUAGE C)
50 set_property(SOURCE release.h PROPERTY LANGUAGE C)
52 if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
53 add_library(config STATIC lib.c)
54 target_sources(config INTERFACE FILE_SET HEADERS FILES $<IF:$<CONFIG:Debug>,debug.h,release.h>)
57 add_library(lang_test_c STATIC lib.c)
58 target_sources(lang_test_c INTERFACE FILE_SET HEADERS FILES lang_test.h)
60 add_library(lang_test_cxx STATIC lib.c lib.cxx)
61 target_compile_definitions(lang_test_cxx INTERFACE EXPECT_CXX)
62 target_sources(lang_test_cxx INTERFACE FILE_SET HEADERS FILES lang_test.h)
64 add_library(interface_lang_test_cxx INTERFACE)
65 target_compile_definitions(interface_lang_test_cxx INTERFACE EXPECT_CXX)
66 target_sources(interface_lang_test_cxx INTERFACE FILE_SET HEADERS FILES lang_test.h)
68 set_property(SOURCE error.h PROPERTY LANGUAGE C)
70 add_library(list STATIC lib.c)
71 target_sources(list INTERFACE
72 FILE_SET a TYPE HEADERS FILES a.h
73 FILE_SET c TYPE HEADERS FILES dir/c.h
74 FILE_SET error TYPE HEADERS FILES error.h
76 set_property(TARGET list PROPERTY INTERFACE_HEADER_SETS_TO_VERIFY "a;c")