blob: 01f9a7c9cc83115dcbc8968432fa4f83184ad1cb [file] [log] [blame]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7025c0db4b..d13a7f90cf8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,8 @@
# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 2.8)
-# Set project name.
-project(OpenVRSDK)
-
# Setup some options.
option(BUILD_SHARED "Builds the library as shared library" OFF)
-option(BUILD_FRAMEWORK "Builds the library as an apple Framework" OFF)
-option(BUILD_UNIVERSAL "Builds the shared or framework as a universal (fat, 32- & 64-bit) binary" ON)
-option(BUILD_OSX_I386 "Builds the shared or framework as a 32-bit binary, even on a 64-bit platform" OFF)
option(USE_LIBCXX "Uses libc++ instead of libstdc++" ON)
option(USE_CUSTOM_LIBCXX "Uses a custom libc++" OFF)
@@ -37,21 +31,9 @@ elseif(APPLE)
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*" OR CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
set(PLATFORM_NAME "osx")
add_definitions(-DOSX -DPOSIX)
- if(BUILD_UNIVERSAL)
- set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
- endif()
- if(BUILD_OSX_I386)
- set(PROCESSOR_ARCH "32")
- set(CMAKE_OSX_ARCHITECTURES "i386")
- endif()
endif()
endif()
-# Set output folder for static and shared libraries
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_NAME}${PROCESSOR_ARCH})
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_NAME}${PROCESSOR_ARCH})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_NAME}${PROCESSOR_ARCH})
-
# Enable some properties.
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Enable c++11 and hide symbols which shouldn't be visible
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e58c9e1c039..095f81e562b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,8 +1,10 @@
-# Project name.
-project(openvr_api)
+set(OPENVR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source/ThirdParty/openvr)
set( LIBNAME "openvr_api" )
+set(EXCEPTION_FLAGS "-fexceptions")
+add_definitions(${EXCEPTION_FLAGS})
+
# Set some properies for specific files.
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
@@ -22,7 +24,7 @@ elseif(WIN32)
endif()
# Add include folders.
-include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/headers ${CMAKE_SOURCE_DIR}/src/vrcommon)
+include_directories(${OPENVR_SOURCE_DIR}/src ${OPENVR_SOURCE_DIR}/headers ${OPENVR_SOURCE_DIR}/src/vrcommon)
if(USE_CUSTOM_LIBCXX)
link_directories(
@@ -65,28 +67,35 @@ elseif(BUILD_FRAMEWORK)
set( LIBNAME "OpenVR" )
add_library( ${LIBNAME}
SHARED ${SOURCE_FILES}
- ${CMAKE_SOURCE_DIR}/headers/openvr.h
- ${CMAKE_SOURCE_DIR}/headers/openvr_api.cs
- ${CMAKE_SOURCE_DIR}/headers/openvr_api.json
- ${CMAKE_SOURCE_DIR}/headers/openvr_capi.h
- ${CMAKE_SOURCE_DIR}/headers/openvr_driver.h
+ ${OPENVR_SOURCE_DIR}/headers/openvr.h
+ ${OPENVR_SOURCE_DIR}/headers/openvr_api.cs
+ ${OPENVR_SOURCE_DIR}/headers/openvr_api.json
+ ${OPENVR_SOURCE_DIR}/headers/openvr_capi.h
+ ${OPENVR_SOURCE_DIR}/headers/openvr_driver.h
)
set_target_properties(OpenVR PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A
MACOSX_FRAMEWORK_IDENTIFIER com.valvesoftware.OpenVR.framework
- MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/Info.plist
+ MACOSX_FRAMEWORK_INFO_PLIST ${OPENVR_SOURCE_DIR}/src/Info.plist
# "current version" in semantic format in Mach-O binary file
VERSION 1.0.6
# "compatibility version" in semantic format in Mach-O binary file
SOVERSION 1.0.0
- PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/headers/openvr.h;${CMAKE_SOURCE_DIR}/headers/openvr_api.cs;${CMAKE_SOURCE_DIR}/headers/openvr_api.json;${CMAKE_SOURCE_DIR}/headers/openvr_capi.h;${CMAKE_SOURCE_DIR}/headers/openvr_driver.h"
+ PUBLIC_HEADER "${OPENVR_SOURCE_DIR}/headers/openvr.h;${OPENVR_SOURCE_DIR}/headers/openvr_api.cs;${OPENVR_SOURCE_DIR}/headers/openvr_api.json;${OPENVR_SOURCE_DIR}/headers/openvr_capi.h;${OPENVR_SOURCE_DIR}/headers/openvr_driver.h"
LINKER_LANGUAGE CXX
)
else()
add_library(${LIBNAME} STATIC ${SOURCE_FILES})
endif()
+if (COMPILER_IS_GCC_OR_CLANG)
+ WEBKIT_ADD_TARGET_CXX_FLAGS(${LIBNAME} -Wno-implicit-fallthrough
+ -Wno-unknown-pragmas
+ -Wno-unused-parameter
+ -Wno-unused-variable)
+endif()
+
if(USE_CUSTOM_LIBCXX)
set(EXTRA_LIBS ${EXTRA_LIBS} c++ c++abi)
endif()