-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
129 lines (94 loc) · 1.72 KB
/
CMakeLists.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#
# External dependencies
#
find_package(cppassist REQUIRED)
find_package(cppexpose REQUIRED)
#
# Executable name and options
#
# Target name
set(target glkernel-cmd)
#
# Sources
#
set(headers
KernelGeneration.h
KernelToJson.h
)
set(sources
main.cpp
KernelGeneration.cpp
)
set(header_group "Header Files (API)")
set(source_group "Source Files")
source_group_by_path(${CMAKE_CURRENT_SOURCE_DIR} "\\\\.h$"
${header_group} ${headers})
source_group_by_path(${CMAKE_CURRENT_SOURCE_DIR} "\\\\.cpp$"
${source_group} ${sources})
#
# Create executable
#
# Build executable
add_executable(${target}
${sources}
${headers}
)
# Create namespaced alias
add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target})
#
# Project options
#
set_target_properties(${target}
PROPERTIES
${DEFAULT_PROJECT_OPTIONS}
FOLDER "${IDE_FOLDER}"
)
#
# Include directories
#
target_include_directories(${target}
PRIVATE
${DEFAULT_INCLUDE_DIRECTORIES}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/source/include
)
#
# Libraries
#
target_link_libraries(${target}
PRIVATE
${DEFAULT_LIBRARIES}
cppassist::cppassist
cppexpose::cppexpose
${META_PROJECT_NAME}::glkernel
)
#
# Compile definitions
#
target_compile_definitions(${target}
PRIVATE
GLM_FORCE_RADIANS
${DEFAULT_COMPILE_DEFINITIONS}
)
#
# Compile options
#
target_compile_options(${target}
PRIVATE
${DEFAULT_COMPILE_OPTIONS}
)
#
# Linker options
#
target_link_libraries(${target}
PRIVATE
${DEFAULT_LINKER_OPTIONS}
)
#
# Deployment
#
# Executable
install(TARGETS ${target}
RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT examples
BUNDLE DESTINATION ${INSTALL_BIN} COMPONENT examples
)