-
Notifications
You must be signed in to change notification settings - Fork 298
/
CMakeLists.txt
executable file
·49 lines (40 loc) · 1.51 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
# Base Io build system
# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
#
# Builds the GLFW addon
# Find GLFW
find_package(GLFW)
find_package(OpenGL)
find_package(GLUT)
# Create the _build bundle hierarchy if needed.
make_build_bundle(_build)
# Did we find GLFW? if so, set up the targets and all the support
# variables.
if(GLFW_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
# Output our dynamic library to the top-level _build hierarchy
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
# Additional include directories
include_directories(
${GLFW_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../OpenGL/source
)
add_definitions(-DGLFW_DLL)
# Generate the IoGLFWInit.c file.
# Argument SHOULD ALWAYS be the exact name of the addon, case is
# important.
generate_ioinit(GLFW)
# Our library sources.
set(SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLFW.c"
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLFWInit.c"
)
# Now build the shared library
add_library(IoGLFW SHARED ${SRCS})
add_dependencies(IoGLFW iovmall)
target_link_libraries(IoGLFW iovmall ${GLFW_LIBRARY} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
# Install the addon to our global addons hierarchy.
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/GLFW)
endif(GLFW_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)