forked from internaut/ogles_gpgpu
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
83 lines (62 loc) · 2.36 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
# Copyright (c) 2015-2017, David Hirvonen, Ruslan Baratov
# All rights reserved.
cmake_minimum_required(VERSION 3.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.18.55.tar.gz"
SHA1 "0dcfb305e43e492bec485b7404827b3b5dd4d2e6"
LOCAL
)
project(ogles_gpgpu VERSION 0.2.0)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# See: cmake/Hunter/config.cmake
hunter_add_package(Sugar)
include("${SUGAR_ROOT}/cmake/Sugar")
include(sugar_include)
string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" is_linux)
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()
option(OGLES_GPGPU_BUILD_EXAMPLES "Build examples" OFF)
option(OGLES_GPGPU_INSTALL "Perform installation" ON)
option(OGLES_GPGPU_VERBOSE "Perform per filter logging" OFF)
## #################################################################
## Testing:
## #################################################################
# 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
option(OGLES_GPGPU_BUILD_TESTS "Build shader unit tests" OFF)
if(OGLES_GPGPU_BUILD_TESTS)
enable_testing()
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)
list(APPEND OGLES_GPGPU_TEST_LIBS GTest::gtest)
# Include glfw for lightweight hidden window opengl context:
# Alternatives: boost or glm for iOS and Android
if(NOT (IOS OR ANDROID))
hunter_add_package(glfw)
find_package(glfw3 REQUIRED)
list(APPEND OGLES_GPGPU_TEST_LIBS glfw)
set(ogles_gpgpug_has_glfw TRUE)
endif()
hunter_add_package(OpenCV)
find_package(OpenCV REQUIRED)
list(APPEND OGLES_GPGPU_TEST_LIBS "${OpenCV_LIBS}")
endif()
## #################################################################
## Project
## #################################################################
add_subdirectory(ogles_gpgpu)
## #################################################################
## Examples
## #################################################################
if(OGLES_GPGPU_BUILD_EXAMPLES)
message("BUILD EXAMPLES.......")
add_subdirectory(examples)
endif()