From b6b7f06322f958e152ffa2daab1c6be0d7ab2e18 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 25 Oct 2013 16:59:58 -0700 Subject: Updating unix library discovery --- LibOVR/CMakeLists.txt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'LibOVR/CMakeLists.txt') diff --git a/LibOVR/CMakeLists.txt b/LibOVR/CMakeLists.txt index ce9c8bb..549589b 100644 --- a/LibOVR/CMakeLists.txt +++ b/LibOVR/CMakeLists.txt @@ -135,10 +135,25 @@ elseif(APPLE) else() - # FIXME switch to pkg-config for this? - SET(OculusVR_EXTRA_LIBS edid pthread udev X11 Xrandr) + find_package(X11 REQUIRED) + # Set up library and include paths + list(APPEND OculusVR_EXTRA_LIBS ${X11_X11_LIB}) + + # 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 ) endif() + add_library(OculusVR STATIC ${SOURCE_FILES} ${HEADER_FILES}) +set(OVR_LIBRARIES ${OculusVR_EXTRA_LIBS} CACHE STRING "Dependencies of OculusVR") target_link_libraries(OculusVR ${OculusVR_EXTRA_LIBS}) -- cgit v1.2.3