-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (61 loc) · 2.95 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
##############################################################################
# #
# This file is part of nyx, a lightweight C++ template library for OpenGL #
# #
# Copyright (C) 2012 Alexandru Duliu #
# #
# nyx is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Lesser General Public #
# License as published by the Free Software Foundation; either #
# version 3 of the License, or (at your option) any later version. #
# #
# nyx is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with nyx. If not, see <http://www.gnu.org/licenses/>. #
# #
##############################################################################
cmake_minimum_required(VERSION 2.8)
project(Nyx)
# guard against in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ")
endif()
# set some variabiles
set( CMAKE_BUILD_TYPE Debug )
if( NOT WIN32 )
set( BUILD_SHARED_LIBS TRUE )
endif()
# configure the project
include( NyxConfig.cmake )
# add the include files
list( APPEND Nyx_INC
include/nyx/array_buffer.hpp
include/nyx/buffer.hpp
include/nyx/color_array_buffer.hpp
include/nyx/element_buffer.hpp
include/nyx/frame_buffer_object.hpp
include/nyx/gl.hpp
include/nyx/normal_array_buffer.hpp
include/nyx/program.hpp
include/nyx/shader.hpp
include/nyx/texcoord_array_buffer.hpp
include/nyx/texture.hpp
include/nyx/util.hpp
include/nyx/vertex_array_buffer.hpp
include/nyx/vertex_buffer_object.hpp )
# set include directories
include_directories( ${Nyx_INCLUDE_DIRS} )
# add the target
add_custom_target( ${Nyx_TARGET} SOURCES ${Nyx_INC} )
# install
install(FILES ${Nyx_INC} DESTINATION "include/nyx" )
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/FindNyx.cmake" DESTINATION share )
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/FindGLEW.cmake" DESTINATION share )
# enable testing
ENABLE_TESTING()
# add tests
add_subdirectory(test)