-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeUtility.cmake
61 lines (42 loc) · 1.04 KB
/
CMakeUtility.cmake
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
if(WIN32)
set(OWL_SYSTEM_WINDOWS TRUE)
elseif(UNIX)
set(OWL_SYSTEM_LINUX TRUE)
endif()
# Determines if the library is statically compiled
if(LIBTYPE STREQUAL "STATIC")
set(OWL_BUILD_STATIC TRUE)
endif()
# Determines the preffered windowing subsystem on linux
# if(DISABLE_WAYLAND STREQUAL "YES")
# set(OWL_WAYLAND_OFF TRUE)
# set(OWL_X11_ON TRUE)
#
# elseif(DISABLE_X11 STREQUAL "YES")
# set(OWL_WAYLAND_ON TRUE)
# set(OWL_X11_OFF TRUE)
#
# endif()
# Determines if building examples is enabled
if(BUILD_EXAMPLES STREQUAL "NO")
set(OWL_EXAMPLES_OFF TRUE)
else()
set(OWL_EXAMPLES_ON TRUE)
endif()
# Sets the executable type
if(OWL_SYSTEM_WINDOWS)
set(OWL_EXE_TYPE WIN32)
else()
set(OWL_EXE_TYPE )
endif()
# Adds an executable target for our examples
function(OWL_AddExample name)
file(GLOB_RECURSE ${name}_srcs
"examples/${name}/*.hpp"
"examples/${name}/*.cpp"
)
add_executable(${name} ${OWL_EXE_TYPE} ${${name}_srcs})
if(OWL_BUILD_STATIC)
target_compile_definitions(${name} PRIVATE OWL_BUILD_STATIC)
endif()
endfunction()