-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (53 loc) · 1.61 KB
/
CMakeLists.txt
File metadata and controls
71 lines (53 loc) · 1.61 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 3.0)
project(basic)
file(GLOB_RECURSE src "build/c/exe/*")
add_executable(exe_c ${src})
file(GLOB_RECURSE src "build/cpp/exe/*")
add_executable(exe ${src})
target_compile_definitions(exe PUBLIC
AND_MY_STRING=""
)
file(GLOB_RECURSE src "build/cpp/dll/*")
add_library(mydll SHARED ${src})
file(GLOB_RECURSE src "build/cpp/lib/*")
add_library(mylib ${src})
project(deps)
file(GLOB_RECURSE src "build/cpp/dep/exe_dll/main.cpp")
add_executable(exe1 ${src})
target_link_libraries(exe1 dll1)
file(GLOB_RECURSE src "build/cpp/dep/exe_dll/a*")
add_library(dll1 SHARED ${src})
set(def "MY_API=__declspec(dllexport)")
set(def2 "MY_API=__declspec(dllimport)")
target_compile_definitions(dll1
PRIVATE ${def}
INTERFACE ${def2}
)
file(GLOB_RECURSE src "build/cpp/dep/exe_lib/main.cpp")
add_executable(exe2 ${src})
target_link_libraries(exe2 lib2)
file(GLOB_RECURSE src "build/cpp/dep/exe_lib/a*")
add_library(lib2 ${src})
set(def "MY_API=")
target_compile_definitions(lib2
PUBLIC ${def}
)
file(GLOB_RECURSE src "build/cpp/dep/exe_dll_dll/main.cpp")
add_executable(exe3 ${src})
target_link_libraries(exe3 dll3a dll3b)
file(GLOB_RECURSE src "build/cpp/dep/exe_dll_dll/a*")
add_library(dll3a SHARED ${src})
set(def "A_API=__declspec(dllexport)")
set(def2 "A_API=__declspec(dllimport)")
target_compile_definitions(dll3a
PRIVATE ${def}
INTERFACE ${def2}
)
file(GLOB_RECURSE src "build/cpp/dep/exe_dll_dll/b*")
add_library(dll3b SHARED ${src})
set(def "B_API=__declspec(dllexport)")
set(def2 "B_API=__declspec(dllimport)")
target_compile_definitions(dll3b
PRIVATE ${def}
INTERFACE ${def2}
)