-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (55 loc) · 2.02 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
cmake_minimum_required (VERSION 3.2)
project (wrangle-gl)
# test-egl
include_directories ("include")
add_executable ("test-egl"
"include/wrangle.h"
"include/wrangle-egl.h"
"src/wrangle-egl.cpp"
"tests/test-egl.cpp")
target_compile_options ("test-egl"
PUBLIC "-DGLEW_USE_EGL")
if(WIN32)
# https://developer.arm.com/-/media/Files/downloads/open-gl-es-emulator/3.0.4/Mali_OpenGL_ES_Emulator-v3.0.4-2-g8d905-Windows-64bit.zip?revision=89a52b4d-c891-4abc-be58-50db8c20bff9?product=OpenGL%20ES%20Emulator,64-bit,,Windows,3.0.4
#target_link_libraries ("test-egl"
# "${CMAKE_CURRENT_SOURCE_DIR}/khronos/emulator/ARM/libEGL.lib"
# "${CMAKE_CURRENT_SOURCE_DIR}/khronos/emulator/ARM/libGLESv2.lib")
#configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/khronos/emulator/AMD/x86/libEGL.dll" "${CMAKE_CURRENT_BINARY_DIR}/libEGL.dll" COPYONLY)
#configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/khronos/emulator/AMD/x86/libGLESv2.dll" "${CMAKE_CURRENT_BINARY_DIR}/libGLESv2.dll" COPYONLY)
else()
find_package(OpenGL REQUIRED COMPONENTS EGL)
if(NOT OPENGL_FOUND)
message(SEND_ERROR "Error: No OpenGL found.")
endif()
target_link_libraries ("test-egl"
"${OPENGL_egl_LIBRARY}"
"${OPENGL_opengl_LIBRARY}"
dl)
endif()
if(WIN32)
set_target_properties("test-egl" PROPERTIES
LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
endif()
# test-wgl (Windows only)
if(WIN32)
add_executable ("test-wgl"
"include/wrangle.h"
"include/wrangle-wgl.h"
"include/wrangle-gl.h"
"include/wrangle-gles.h"
"src/wrangle-wgl.cpp"
"src/wrangle-gl.cpp"
"src/wrangle-gles.cpp"
"tests/test-wgl.cpp")
target_compile_options ("test-wgl"
PUBLIC "-DGLEW_USE_WGL"
PUBLIC "-DGLEW_USE_OPENGL_ES")
set_target_properties("test-wgl" PROPERTIES
LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS"
LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
endif()