forked from ptitSeb/gl4es
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·83 lines (69 loc) · 2.56 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
cmake_minimum_required(VERSION 2.6)
project(glshim)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
option(BCMHOST "Set to ON if targeting an RPi(2) device" ${BCMHOST})
option(ODROID "Set to ON if targeting an ODroid device" ${ODROID})
option(CHIP "Set to ON if targeting an C.H.I.P. device" ${CHIP})
option(AMIGAOS4 "Set to ON if targeting an AmigaOS4/Warp3D platform (activate NOEGL and NOX11)" ${AMIGAOS4})
option(NOX11 "Set to ON to not use X11 (creation of context has to be done outside gl4es)" ${NOX11})
option(NOEGL "Set to ON to not use EGL (all functions are taken in GLES library)" ${NOEGL})
option(STATICLIB "Set to ON to build a static version of gl4es" ${STATICLIB})
# Raspberry PI
if(BCMHOST)
include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux)
link_directories(/opt/vc/lib)
add_definitions(-DBCMHOST)
set(NOX11 ON)
set(NOEGL ON)
add_definitions(-marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -ffast-math -fomit-frame-pointer)
endif()
# Pandora
if(PANDORA)
add_definitions(-DPANDORA)
add_definitions(-DTEXSTREAM)
add_definitions(-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -fsingle-precision-constant -ffast-math)
endif()
# ODROID
if(ODROID)
add_definitions(-DODROID)
set(NOX11 ON)
set(NOEGL ON)
add_definitions(-marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -ffast-math -fomit-frame-pointer)
endif()
#PocketCHIP
if(CHIP)
add_definitions(-DCHIP)
add_definitions(-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -fsingle-precision-constant -ffast-math)
endif()
# AmigaOS4
if(AMIGAOS4)
set(CMAKE_C_COMPILER "ppc-amigaos-gcc")
set(CMAKE_CXX_COMPILER "ppc-amigaos-g++")
set(CMAKE_LINKER "ppc-amigaos-ld")
set(CMAKE_AR "ppc-amigaos-ar")
set(CMAKE_RANLIB "ppc-amigaos-ranlib")
add_definitions(-DAMIGAOS4)
set(NOX11 ON)
set(NOEGL ON)
endif()
#NOX11
if(NOX11)
add_definitions(-DNOX11)
endif()
#NOEGL
if(NOEGL)
add_definitions(-DNOEGL)
add_definitions(-DNOX11)
endif()
#DEFAULT_ES=2
if("${DEFAULT_ES}" STREQUAL "2")
add_definitions(-DDEFAULT_ES=2)
endif()
link_directories(${CMAKE_BINARY_DIR}/lib)
add_definitions(-g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden)
include_directories(include)
add_subdirectory(src)