forked from structureio/uplink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (52 loc) · 1.22 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
cmake_minimum_required(VERSION 3.2)
project(uplink)
include_directories(
headers
sources
dependencies/headers
)
file(GLOB_RECURSE uplink_SOURCES headers/*)
list(APPEND uplink_SOURCES
sources/uplink.cpp
)
set(uplink_LIBS)
if(WIN32)
list(APPEND uplink_LIBS
Gdiplus
Shlwapi
glfw3
OpenGL32
)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
link_directories(
dependencies/binaries/win64
)
endif()
elseif(APPLE)
list(APPEND uplink_LIBS
"-framework CoreFoundation"
"-framework Cocoa"
"-framework OpenGL"
"-framework CoreVideo"
"-framework IOKit"
glfw3
)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
link_directories(
dependencies/binaries/osx
)
endif()
endif()
macro(uplink_app name) # source ...
add_executable(${name} ${uplink_SOURCES} "${ARGN}")
target_link_libraries(${name} ${uplink_LIBS})
target_compile_features(${name} PRIVATE
cxx_lambdas
)
endmacro()
uplink_app(example-server examples/example-desktop-server.cpp)
file(COPY
examples/auto-level-button.png
examples/example-desktop-server.cpp
DESTINATION . # relative to build directory
)