summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: ab3542e89b3e17e7268d3f68c2ad0e67921c9285 (plain)
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
project(OculusSDK)

cmake_minimum_required(VERSION 2.8)

# Support our own custom modules
list(APPEND CMAKE_MODULE_PATH
    ${CMAKE_SOURCE_DIR}/CMake/Modules
)

# Comment out these two lines to disable the debug build
set(CMAKE_BUILD_TYPE "Debug")
add_definitions(-DOVR_BUILD_DEBUG)

#set(CMAKE_VERBOSE_MAKEFILE ON)

if(CMAKE_COMPILER_IS_GNUCXX)
    add_definitions(-std=gnu++0x)
    if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC"  )
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC"  )    
    endif()
endif()


if(WIN32)
    add_definitions(-DUNICODE -D_UNICODE)
endif()

# Used by the SDK to read the EDID of the monitors
if(UNIX AND NOT(APPLE) AND NOT(CYGWIN))
    add_subdirectory(3rdParty/EDID)
endif()

# The primary SDK artifact, a static library for Oculus access 
add_subdirectory(LibOVR)

###############################################################################
#
# Sample code support
#

# Make sure to set up the OVR include paths
include_directories(${LibOVR_SOURCE_DIR}/Include)
include_directories(${LibOVR_SOURCE_DIR}/Src)
include_directories(${LibOVR_SOURCE_DIR}/Src/Kernel)
include_directories(${LibOVR_SOURCE_DIR}/Src/Util)

# Cross platform window creation
add_subdirectory(3rdParty/glfw)
include_directories(${CMAKE_SOURCE_DIR}/3rdParty/glfw/include)

# Cross platform access to shader functionality
add_definitions( -DGLEW_STATIC )
add_subdirectory(3rdParty/glew)
include_directories(${CMAKE_SOURCE_DIR}/3rdParty/glew/include)

# Used by the sample code to read the tuscany resources
add_subdirectory(3rdParty/TinyXml)
include_directories(${CMAKE_SOURCE_DIR}/3rdParty/TinyXml)

add_definitions( -DGL_GLEXT_PROTOTYPES )
add_subdirectory (Samples/CommonSrc )
add_subdirectory (Samples/OculusWorldDemo )
add_subdirectory (Samples/OculusRoomTiny )
add_subdirectory (Samples/SensorBox )
add_subdirectory (Samples/TestSensor )