-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
28 lines (20 loc) · 861 Bytes
/
CMakeLists.txt
File metadata and controls
28 lines (20 loc) · 861 Bytes
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
cmake_minimum_required (VERSION 2.6)
project(eglut LANGUAGES C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
find_package(PNG REQUIRED)
find_package(EGL REQUIRED)
set(EGLUT_USE_X11 true)
set(EGLUT_SOURCES include/eglut.h src/eglut.c src/eglutint.h)
set(EGLUT_X11_SOURCES src/eglut_x11.c include/eglut_x11.h src/xinput.c src/xinput.h)
if (EGLUT_USE_X11)
find_package(X11 REQUIRED)
set(EGLUT_SOURCES ${EGLUT_SOURCES} ${EGLUT_X11_SOURCES})
endif()
add_library(eglut ${EGLUT_SOURCES})
target_include_directories(eglut PUBLIC include/)
target_include_directories(eglut PRIVATE ${EGL_INCLUDE_DIRS})
target_link_libraries(eglut PUBLIC ${PNG_LIBRARIES} ${EGL_LIBRARIES})
if (EGLUT_USE_X11)
target_link_libraries(eglut PUBLIC ${X11_X11_LIB})
target_include_directories(eglut PRIVATE ${X11_INCLUDE_DIR})
endif()