forked from jherico/OculusSDK
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
68 lines (55 loc) · 2.38 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
project(OculusSDK)
cmake_minimum_required(VERSION 2.8)
# Support our own custom modules
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake/Modules
)
# First for the generic no-config case (e.g. with mingw)
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output )
# Second, for multi-config builds (e.g. msvc)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/output )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/output )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/output )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOVR_BUILD_DEBUG")
set(CMAKE_DEBUG_POSTFIX "d")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
if(CMAKE_COMPILER_IS_GNUCXX)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
if(WIN32)
add_definitions(-DUNICODE -D_UNICODE)
elseif(APPLE)
else()
endif()
# The primary SDK artifact, a static library for Oculus access
add_subdirectory(LibOVR)
set_target_properties(OculusVR PROPERTIES FOLDER "Oculus")
###############################################################################
#
# Sample code support
#
option(OCULUS_BUILD_SAMPLES "Build Oculus demos" TRUE)
if(OCULUS_BUILD_SAMPLES)
# Used by the sample code to read the tuscany resources
add_subdirectory(3rdParty/TinyXml)
set_target_properties(TinyXML2 PROPERTIES FOLDER "3rdParty")
include_directories(3rdParty/TinyXml)
# Make sure to set up the OVR include paths
include_directories(${OculusVR_SOURCE_DIR}/Include)
include_directories(${OculusVR_SOURCE_DIR}/Src)
include_directories(${OculusVR_SOURCE_DIR}/Src/Kernel)
include_directories(${OculusVR_SOURCE_DIR}/Src/Util)
add_subdirectory (Samples/CommonSrc )
set_target_properties(CommonSrc PROPERTIES FOLDER "Samples")
add_subdirectory (Samples/OculusWorldDemo )
set_target_properties(OculusWorldDemo PROPERTIES FOLDER "Samples")
endif()