blob: 58b70a31c7dfabd6205e768240c64fa54d9680f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
cmake_minimum_required(VERSION 3.22...3.24)
enable_language(C)
# Create framework and ensure header is placed in Headers
set(input_header "${CMAKE_SOURCE_DIR}/Gui.h")
add_library(Gui SHARED Gui.c "${input_header}")
set_target_properties(Gui PROPERTIES
PUBLIC_HEADER "${input_header}"
FRAMEWORK TRUE
)
add_executable(app main.c)
target_link_libraries(app PRIVATE Gui)
# Same test but with generation done in custom directories
add_library(Gui2 SHARED Gui.c "${input_header}")
set_target_properties(Gui2 PROPERTIES
PUBLIC_HEADER "${input_header}"
FRAMEWORK TRUE
LIBRARY_OUTPUT_DIRECTORY lib
)
add_executable(app2 main2.c)
set_target_properties(Gui2 PROPERTIES
PUBLIC_HEADER "${input_header}"
FRAMEWORK TRUE
RUNTIME_OUTPUT_DIRECTORY bin
)
target_link_libraries(app2 PRIVATE Gui2)
|