-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
48 lines (36 loc) · 1.23 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
project(screensaver.shadertoy)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
find_package(Kodi REQUIRED)
find_package(p8-platform REQUIRED)
find_package(OpenGL)
if(OPENGL_FOUND)
find_package(GLEW REQUIRED)
set(INCLUDES ${OpenGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR})
add_definitions(-DHAS_OPENGL)
set(DEPLIBS ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES})
else()
find_package(OpenGLES2)
if(OPENGLES2_FOUND)
set(INCLUDES ${OPENGLES2_INCLUDE_DIR})
add_definitions(-DHAS_GLES2 -DHAS_GLES)
set(DEPLIBS ${OPENGLES2_LIBRARIES})
else()
message(FATAL_ERROR "No rendering API found. Bailing")
endif()
endif()
include_directories(${INCLUDES}
${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways
${p8-platform_INCLUDE_DIRS}
${CMAKE_INCLUDE_PATH})
set(SHADERTOY_SOURCES src/lodepng.cpp
src/main.cpp)
set(SHADERTOY_HEADERS src/lodepng.h)
set(DEPLIBS ${DEPLIBS})
if(APPLE)
set(DEPLIBS ${DEPLIBS} "-framework CoreVideo")
endif()
add_options(CXX ALL_BUILDS -std=c++11)
build_addon(screensaver.shadertoy SHADERTOY DEPLIBS)
include(CPack)