-
Notifications
You must be signed in to change notification settings - Fork 0
/
NyxConfig.cmake
78 lines (64 loc) · 2.95 KB
/
NyxConfig.cmake
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
73
74
75
##############################################################################
# #
# 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/>. #
# #
##############################################################################
# Config file for the nyx library
# It defines the following variables
#
# Nyx_INCLUDE_DIR - include directory for nyx headers
# Nyx_INCLUDE_DIRS - all include directories nyx needs
# Nyx_LINK_LIBRARIES - all include directories nyx needs
# set path
set( Nyx_DIR ${CMAKE_CURRENT_LIST_DIR})
set( ENV{Nyx_DIR} ${Nyx_DIR} )
# add module paths
list( APPEND CMAKE_MODULE_PATH
${Nyx_DIR}/cmake
${CMAKE_INSTALL_PREFIX}/share )
# find OpenGL
find_package( OpenGL REQUIRED )
find_package( GLEW REQUIRED )
# set the include dir
set( Nyx_INCLUDE_DIR "${Nyx_DIR}/include")
# set target names
set( Nyx_TARGET nyx )
# set compile definitions
set( Nyx_COMPILE_DEFINITIONS NYX CACHE INTERNAL "all compile definitions nyx needs" )
# set linker flags
if( WIN32 )
list( APPEND Nyx_LINK_FLAGS " /MANIFEST:NO" )
endif()
# set include directories
set( Nyx_INCLUDE_DIRS
${Nyx_INCLUDE_DIR}
${CMAKE_INSTALL_PREFIX}/include
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_PATH} CACHE INTERNAL "all include directories nyx needs" )
# link libraries
set( Nyx_LINK_LIBRARIES
${OPENGL_LIBRARIES}
${GLEW_LIBRARY} CACHE INTERNAL "all libs nyx needs" )
# enable C++11 support
#if( NOT WIN32 )
# if( CMAKE_COMPILER_IS_GNUCXX )
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
# else( CMAKE_COMPILER_IS_GNUCXX )
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Qunused-arguments")
# endif()
#endif()