This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
forked from headupinclouds/ogles_gpgpu
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
111 lines (87 loc) · 3.25 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
# Copyright (c) 2015-2017, David Hirvonen, Ruslan Baratov
# All rights reserved.
cmake_minimum_required(VERSION 3.0)
include("cmake/hunter_cache_update.cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.151.tar.gz"
SHA1 "68657b81508c2d3c248731b5a0c2125f19866721"
LOCAL
)
project(ogles_gpgpu VERSION 0.3.10)
# !!! Make sure option OGLES_GPGPU_OPENG_ES3 occurs prior to the first
# hunter_add_package() call. This will allow us to modify settings
# in dependencies appropriately (see cmake/Hunter/config.cmake)
if(IOS OR ANDROID)
set(ogles_gpgpu_opengl_es2_dflt ON)
set(ogles_gpgpu_opengl_es3_dflt OFF)
else()
set(ogles_gpgpu_opengl_es2_dflt OFF)
set(ogles_gpgpu_opengl_es3_dflt OFF)
endif()
option(OGLES_GPGPU_OPENGL_ES2 "Use OpenGL ES 2.0" ${ogles_gpgpu_opengl_es2_dflt})
option(OGLES_GPGPU_OPENGL_ES3 "Use OpenGL ES 3.0" ${ogles_gpgpu_opengl_es3_dflt})
option(OGLES_GPGPU_USE_EGL "Use EGL to manage the context (supports ES)" OFF)
if(OGLES_GPGPU_OPENGL_ES2 AND OGLES_GPGPU_OPENGL_ES3)
message(FATAL_ERROR
"OGLES_GPGPU_OPENGL_ES2 and OGLES_GPGPU_OPENGL_ES3 are mutually exclusive"
)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" is_linux)
option(OGLES_GPGPU_BUILD_EXAMPLES "Build examples" OFF)
option(OGLES_GPGPU_INSTALL "Perform installation" ON)
option(OGLES_GPGPU_VERBOSE "Perform per filter logging" OFF)
option(OGLES_GPGPU_BUILD_TESTS "Build shader unit tests" OFF)
option(OGLES_GPGPU_USE_OSMESA "Use MESA CPU OpenGL (via glfw)" OFF)
hunter_add_package(check_ci_tag)
find_package(check_ci_tag CONFIG REQUIRED)
check_ci_tag()
# See: cmake/Hunter/config.cmake
hunter_add_package(sugar)
find_package(sugar CONFIG REQUIRED)
include(sugar_include)
message("Android: ${ANDROID}")
message("iOS : ${IOS}")
message("Linux : ${is_linux}")
message("Xcode : ${XCODE}")
if(XCODE)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configuration types")
endif()
## #################################################################
## Testing:
## #################################################################
string(COMPARE EQUAL "$ENV{TRAVIS}" "true" travis_ci)
string(COMPARE EQUAL "$ENV{APPVEYOR}" "True" appveyor_ci)
if(travis_ci OR appveyor_ci)
set(OGLES_GPGPU_CI TRUE)
else()
set(OGLES_GPGPU_CI FALSE)
endif()
if(ANDROID OR NOT ${OGLES_GPGPU_CI})
set(OGLES_GPGPU_DO_GPU_TESTING TRUE)
else()
set(OGLES_GPGPU_DO_GPU_TESTING FALSE)
endif()
# Tests can be compiled for all platforms (to tests exe linking),
# but they may only be run on platforms where an OpenGL context
# is available
if(OGLES_GPGPU_BUILD_TESTS)
if(IOS AND DRISHTI_CI)
# do not run test on CI (TODO: remote device testing)
else()
enable_testing()
endif()
endif()
## #################################################################
## Project
## #################################################################
add_subdirectory(ogles_gpgpu)
## #################################################################
## Examples
## #################################################################
if(OGLES_GPGPU_BUILD_EXAMPLES)
message("BUILD EXAMPLES.......")
add_subdirectory(examples)
endif()