-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
54 lines (39 loc) · 1.53 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
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# include cmake/utils.cmake
include(utils)
set(ALFONS_BUILD_RENDERER 1)
message(STATUS "modules : ${CMAKE_MODULE_PATH}")
# cmake output configuration
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# platform lookup
#set(SUPPORTED_TARGETS darwin ios android raspberrypi linux)
set(SUPPORTED_TARGETS android linux)
if(NOT PLATFORM_TARGET)
string(TOLOWER "${CMAKE_SYSTEM_NAME}" varplatform)
string(TOUPPER "${CMAKE_SYSTEM_NAME}" VARPLATFORM)
message(STATUS "No target defined (give as parameter -DPLATFORM_TARGET=platform_name).")
message(STATUS "Targets available: ${SUPPORTED_TARGETS}.")
message(STATUS "Will use your OS: ${varplatform}.")
set(PLATFORM_TARGET ${varplatform})
else()
string(TOLOWER "${PLATFORM_TARGET}" varplatform)
string(TOUPPER "${PLATFORM_TARGET}" VARPLATFORM)
message(STATUS "Platform chosen : ${VARPLATFORM}")
endif()
list(FIND SUPPORTED_TARGETS ${varplatform} target_in_list)
if(target_in_list EQUAL -1)
message(SEND_ERROR "${varplatform} not in supported targets: ${SUPPORTED_TARGETS}")
return()
endif()
# setting up cache variable platform
set(PLATFORM ${varplatform} CACHE INTERNAL "platform" FORCE)
# include(glm)
include(${PLATFORM_TARGET})
#add_library(nanovg
# nanovg/src/nanovg.c)
#target_include_directories(nanovg
# PUBLIC
# nanovg/src)