forked from IVCenter/calvr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (67 loc) · 2.78 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
88
89
90
cmake_minimum_required(VERSION 2.8)
project (CalVR)
SET(CALVR_MAJOR_VERSION 0)
SET(CALVR_MINOR_VERSION 0)
SET(CALVR_VERSION ${CALVR_MAJOR_VERSION}.${CALVR_MINOR_VERSION})
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
INSTALL(DIRECTORY "${CalVR_SOURCE_DIR}/include" DESTINATION include)
SET(CMAKE_MODULE_PATH "${CalVR_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
OPTION(DYNAMIC_LINKING "Set to ON to build CalVR for dynamic linking. Use OFF for static." ON)
IF(DYNAMIC_LINKING)
SET(CALVR_DYNAMIC_OR_STATIC "SHARED")
IF(APPLE)
SET(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
ENDIF(APPLE)
ELSE (DYNAMIC_LINKING)
SET(CALVR_DYNAMIC_OR_STATIC "STATIC")
ADD_DEFINITIONS(-DCVR_LIBRARY_STATIC)
ENDIF(DYNAMIC_LINKING)
OPTION(BUILD_APPS "Build CalVR Applications" OFF)
IF(NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE RelWithDebInfo)
ENDIF(NOT CMAKE_BUILD_TYPE)
INCLUDE(CVRMacros)
FIND_PACKAGE(Threads)
FIND_PACKAGE(MXML)
#FIND_PACKAGE(OpenSceneGraph 2.8.0 COMPONENTS osgDB osgUtil osgViewer osgText osgGA)
FIND_PACKAGE(OSG)
FIND_PACKAGE(Interleaver)
INCLUDE_DIRECTORIES(${MXML_INCLUDE_DIR})
SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
MAKE_DIRECTORY(${OUTPUT_BINDIR})
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/plugins)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
LINK_DIRECTORIES(${OUTPUT_LIBDIR})
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
ENDIF(WIN32)
IF(MSVC)
OPTION(MSVC_VERSIONED_DLL "Set to ON to build with versioned dll names" ON)
MARK_AS_ADVANCED(MSVC_VERSIONED_DLL)
OPTION(MSVC_DEBUG_INCREMENTAL_LINK "Set to OFF to build without incremental linking in debug (release is off by default)" ON)
MARK_AS_ADVANCED(MSVC_DEBUG_INCREMENTAL_LINK)
IF(NOT MSVC_DEBUG_INCREMENTAL_LINK)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
ENDIF(NOT MSVC_DEBUG_INCREMENTAL_LINK)
ADD_DEFINITIONS("/W3 /D_CRT_SECURE_NO_WARNINGS /wd4018 /wd4251")
ENDIF(MSVC)
ADD_SUBDIRECTORY(src)
IF(BUILD_APPS)
ADD_SUBDIRECTORY(applications)
ENDIF(BUILD_APPS)
#IF(PLUGINS_GENERAL OR PLUGINS_CALIT)
# ADD_SUBDIRECTORY(plugins)
#ENDIF(PLUGINS_GENERAL OR PLUGINS_CALIT)
OPTION(MAKE_DOCUMENTATION "Create Doxygen documentation" OFF)
IF(MAKE_DOCUMENTATION)
FIND_PACKAGE(Doxygen)
CONFIGURE_FILE(${CalVR_SOURCE_DIR}/doc/Doxyfile.cmake ${CalVR_SOURCE_DIR}/doc/Doxyfile.txt)
ADD_CUSTOM_TARGET(documentation ALL ${DOXYGEN_EXECUTABLE} ${CalVR_SOURCE_DIR}/doc/Doxyfile.txt)
ENDIF(MAKE_DOCUMENTATION)