-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
87 lines (71 loc) · 3.15 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# CMake Build System for osgLeap
# Copyright (C) 2013 Johannes Kroeger/vtxtech. All rights reserved.
#
# This file is licensed under the GNU Lesser General Public License 3 (LGPLv3),
# but distributed WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
cmake_minimum_required(VERSION 2.8)
PROJECT(osgLeap)
SET(CMAKE_DEBUG_POSTFIX "d")
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
SET(OSG_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Path where to find the osg installation")
INCLUDE(OsgMacroUtils)
#######################################
# Versions
#######################################
SET(OSGLEAP_MAJOR_VERSION 0)
SET(OSGLEAP_MINOR_VERSION 5)
SET(OSGLEAP_PATCH_VERSION 1)
SET(OSGLEAP_VERSION ${OSGLEAP_MAJOR_VERSION}.${OSGLEAP_MINOR_VERSION}.${OSGLEAP_PATCH_VERSION})
SET(OSGLEAP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#######################################
# Library files
#######################################
#FIND_PACKAGE( osg REQUIRED )
# As of this version we use OpenSceneGraph macros instead of OSG...
FIND_PACKAGE( OpenSceneGraph REQUIRED )
IF(NOT(${_osg_VERSION_MAJOR} GREATER 2 AND ${_osg_VERSION_MINOR} GREATER 1))
# OSG-3.2.0 and above
ADD_DEFINITIONS(-DPRE_OSG_320_ARRAYBINDINGS)
ENDIF()
SET(INSTALL_BINDIR "bin")
SET(INSTALL_LIBDIR "lib")
SET(INSTALL_ARCHIVEDIR "lib")
SET(INSTALL_INCDIR "include")
OPTION(OSGLEAP_BUILD_SHARED_LIBS "Set to ON to build osgLeap for dynamic linking. Use OFF for static." ON)
IF (OSGLEAP_BUILD_SHARED_LIBS)
SET(OSGLEAP_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
ELSE (OSGLEAP_BUILD_SHARED_LIBS)
SET(OSGLEAP_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
ENDIF(OSGLEAP_BUILD_SHARED_LIBS)
OPTION(OSGLEAP_BUILD_EXAMPLES "Set to ON to build osgLeap examples." ON)
#OPTION(OSGLEAP_INSTALL_DATA "Set to ON to install osgLeap data." ON)
#SET(OSGLEAP_DATA_INSTALLDIR $ENV{OSG_FILE_PATH} CACHE PATH "Path where to install osgLeap data")
#ADD_SUBDIRECTORY(data)
OPTION(LEAPSDK_080_COMPATIBILITYMODE "Set to ON to enable LeapSDK v0.8.0 compatibility mode. Disable for LeapSDK v0.8.1 or higher" OFF)
IF(LEAPSDK_080_COMPATIBILITYMODE)
ADD_DEFINITIONS(-DLEAPSDK_080_COMPATIBILITYMODE)
ENDIF(LEAPSDK_080_COMPATIBILITYMODE)
SET(OSGLEAP_EXAMPLES_INSTALLDIR "${CMAKE_INSTALL_PREFIX}/share/osgLeap/bin")
INCLUDE_DIRECTORIES(BEFORE
${OPENGL_INCLUDE_DIR}
${OSG_INCLUDE_DIRS}
${OSGLEAP_SOURCE_DIR}/src
${OSGLEAP_SOURCE_DIR}/include
)
ADD_SUBDIRECTORY(src)
IF(OSGLEAP_BUILD_EXAMPLES)
OPTION(OSGLEAP_INSTALL_EXAMPLES "Set to ON to install osgLeap examples." ON)
ADD_SUBDIRECTORY(examples)
ENDIF(OSGLEAP_BUILD_EXAMPLES)
################################################################################
### uninstall target
################################################################################
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")