-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
executable file
·112 lines (83 loc) · 2.07 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
cmake_minimum_required(VERSION 2.8.8)
#---------------------------------------------------------------
# Project
#---------------------------------------------------------------
PROJECT(nanoui)
set(LIBRARY_NAME nanoui)
SET(version_major 0)
SET(version_minor 1)
SET(version_patch 1)
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
#---------------------------------------------------------------
# Platform
#---------------------------------------------------------------
if (MSVC)
set( PLATFORM_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/platforms/windows/include
)
add_definitions(-DNANOVG_GLEW )
add_definitions(-DNANOVG_GL3_IMPLEMENTATION )
elseif (ANDROID)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( PLATFORM_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/platforms/linux/include
)
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fPIC" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -g -fPIC" )
add_definitions(-DNANOVG_GL3_IMPLEMENTATION )
endif ()
#---------------------------------------------------------------
# Defines
#---------------------------------------------------------------
# include
set(INCLUDE_DIR
${PROJECT_SOURCE_DIR}
${PLATFORM_INCLUDE_DIR}
)
set (SOURCES
main.cpp
nanoui.cpp
nanovg.c
)
include_directories(${INCLUDE_DIR})
add_executable(
${LIBRARY_NAME}
${SOURCES}
)
#---------------------------------------------------------------
# Sub Modules
#---------------------------------------------------------------
#---------------------------------------------------------------
# Link
#---------------------------------------------------------------
if (MSVC)
set (EXTERNAL_LIBS
${PROJECT_SOURCE_DIR}/platforms/windows/lib/glfw3.lib
${PROJECT_SOURCE_DIR}/platforms/windows/lib/glew32s.lib
opengl32
)
elseif (ANDROID)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (EXTERNAL_LIBS
GL
GLU
m
GLEW
glfw3
Xxf86vm
pthread
X11
Xrandr
Xinerama
Xi
Xcursor
rt
)
endif (MSVC)
target_link_libraries(
${LIBRARY_NAME}
${EXTERNAL_LIBS}
)