summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2013-12-29 01:11:46 -0800
committerBrad Davis <[email protected]>2013-12-29 01:11:46 -0800
commita91c41e4b21b61c91df3c86c105a1ab08c6d77c6 (patch)
treefe7e7f63ea491f9ad0acb22cefb616d17a054b19
parentcc010856c4413013e229e9344c882a92e7c3d485 (diff)
Tweaking cmake usage
-rw-r--r--.gitmodules3
-rw-r--r--3rdParty/EDID/CMakeLists.txt4
-rw-r--r--3rdParty/TinyXml/CMakeLists.txt6
m---------3rdParty/jsoncpp0
-rw-r--r--CMakeLists.txt5
-rw-r--r--LibOVR/CMakeLists.txt40
6 files changed, 33 insertions, 25 deletions
diff --git a/.gitmodules b/.gitmodules
index 0146d3f..81f81f4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "3rdParty/glfw"]
path = 3rdParty/glfw
url = https://github.com/jherico/glfw.git
+[submodule "3rdParty/jsoncpp"]
+ path = 3rdParty/jsoncpp
+ url = https://github.com/jherico/jsoncpp.git
diff --git a/3rdParty/EDID/CMakeLists.txt b/3rdParty/EDID/CMakeLists.txt
index ae11a6b..e6703ec 100644
--- a/3rdParty/EDID/CMakeLists.txt
+++ b/3rdParty/EDID/CMakeLists.txt
@@ -1,3 +1,3 @@
-project (LibEDID)
-
+cmake_minimum_required(VERSION 2.8)
+project (edid)
add_library(edid STATIC edid.cpp)
diff --git a/3rdParty/TinyXml/CMakeLists.txt b/3rdParty/TinyXml/CMakeLists.txt
index de1d7d2..68bf4df 100644
--- a/3rdParty/TinyXml/CMakeLists.txt
+++ b/3rdParty/TinyXml/CMakeLists.txt
@@ -1,3 +1,3 @@
-project (LibTinyXML2)
-
-add_library(TinyXML2 STATIC tinyxml2.cpp)
+cmake_minimum_required(VERSION 2.8)
+project (TinyXML2)
+add_library(TinyXML2 STATIC tinyxml2.cpp tinyxml2.h)
diff --git a/3rdParty/jsoncpp b/3rdParty/jsoncpp
new file mode 160000
+Subproject d1718a7616cee23d580ac2db5b796890075878c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab3542e..dc99632 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,11 +26,6 @@ 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)
diff --git a/LibOVR/CMakeLists.txt b/LibOVR/CMakeLists.txt
index 549589b..949b589 100644
--- a/LibOVR/CMakeLists.txt
+++ b/LibOVR/CMakeLists.txt
@@ -117,40 +117,50 @@ else()
Src/OVR_Linux_HIDDevice.h
Src/OVR_Linux_HMDDevice.h
)
- list(APPEND EXTRA_LIBS
- edid
- )
- include_directories(${LibEDID_SOURCE_DIR})
endif()
+add_subdirectory(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/jsoncpp
+ ${CMAKE_CURRENT_BINARY_DIR}/../3rdParty/jsoncpp
+)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/jsoncpp)
+
+set(OculusVR_EXTRA_LIBS jsoncpp)
+
if(WIN32)
- SET(OculusVR_EXTRA_LIBS setupapi winmm)
+ list(APPEND OculusVR_EXTRA_LIBS setupapi winmm)
elseif(APPLE)
find_library(COCOA_LIBRARY Cocoa)
find_library(IOKIT_LIBRARY IOKit)
- set(OculusVR_EXTRA_LIBS ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
+ list(APPEND OculusVR_EXTRA_LIBS ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
else()
+ # Used by the SDK to read the EDID of the monitors
+ add_subdirectory(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/EDID
+ ${CMAKE_CURRENT_BINARY_DIR}/../3rdParty/EDID
+ )
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/EDID)
find_package(X11 REQUIRED)
-
- # Set up library and include paths
- list(APPEND OculusVR_EXTRA_LIBS ${X11_X11_LIB})
+ find_package (Threads REQUIRED)
# Check for XRandR (modern resolution switching and gamma control)
if (NOT X11_Xrandr_FOUND)
message(FATAL_ERROR "The RandR library and headers were not found")
endif()
- list(APPEND OculusVR_EXTRA_LIBS ${X11_Xrandr_LIB})
-
- find_package (Threads REQUIRED)
- list(APPEND OculusVR_EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT})
-
- list(APPEND OculusVR_EXTRA_LIBS edid udev )
+ # Set up library and include paths
+ list(APPEND OculusVR_EXTRA_LIBS
+ ${X11_X11_LIB}
+ ${X11_Xrandr_LIB}
+ ${CMAKE_THREAD_LIBS_INIT}
+ edid udev
+ )
endif()