From 68f933462803def9840705e35cbb19f9f7bb0555 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Jul 2014 16:37:10 -0700 Subject: [PATCH] cleanup Faceplus and Faceshift find modules, fix for OVR stitched include --- cmake/modules/FindFaceplus.cmake | 5 +- cmake/modules/FindFaceshift.cmake | 78 ++++++++++++++----------------- cmake/modules/FindLibOVR.cmake | 2 +- interface/CMakeLists.txt | 2 +- 4 files changed, 39 insertions(+), 48 deletions(-) diff --git a/cmake/modules/FindFaceplus.cmake b/cmake/modules/FindFaceplus.cmake index 6783262254..bdb783685f 100644 --- a/cmake/modules/FindFaceplus.cmake +++ b/cmake/modules/FindFaceplus.cmake @@ -19,7 +19,4 @@ if (WIN32) endif (WIN32) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FACEPLUS DEFAULT_MSG FACEPLUS_INCLUDE_DIRS FACEPLUS_LIBRARIES) - -# show the FACEPLUS_INCLUDE_DIRS and FACEPLUS_LIBRARIES variables only in the advanced view -mark_as_advanced(FACEPLUS_INCLUDE_DIRS FACEPLUS_LIBRARIES) +find_package_handle_standard_args(FACEPLUS DEFAULT_MSG FACEPLUS_INCLUDE_DIRS FACEPLUS_LIBRARIES) \ No newline at end of file diff --git a/cmake/modules/FindFaceshift.cmake b/cmake/modules/FindFaceshift.cmake index faf556e06c..39febe3eb3 100644 --- a/cmake/modules/FindFaceshift.cmake +++ b/cmake/modules/FindFaceshift.cmake @@ -18,47 +18,41 @@ # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # -if (FACESHIFT_LIBRARIES AND FACESHIFT_INCLUDE_DIRS) - # in cache already - set(FACESHIFT_FOUND TRUE) -else () - find_path(FACESHIFT_INCLUDE_DIRS fsbinarystream.h ${FACESHIFT_ROOT_DIR}/include) - - if (APPLE) - find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/MacOS/) - elseif (UNIX) - find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/UNIX/) - elseif (WIN32) - # For windows, we're going to build the faceshift sources directly into the interface build - # and not link to a prebuilt library. This is because the VS2010 linker doesn't like cross-linking - # between release and debug libraries. If we change that in the future we can make win32 more - # like the other platforms - #find_library(FACESHIFT_LIBRARIES faceshift.lib ${FACESHIFT_ROOT_DIR}/lib/WIN32/) - endif () - - if (WIN32) - # Windows only cares about the headers - if (FACESHIFT_INCLUDE_DIRS) - set(FACESHIFT_FOUND TRUE) - endif (FACESHIFT_INCLUDE_DIRS) - else () - # Mac and Unix requires libraries - if (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) - set(FACESHIFT_FOUND TRUE) - endif (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) - endif () - - if (FACESHIFT_FOUND) - if (NOT FACESHIFT_FIND_QUIETLY) - message(STATUS "Found Faceshift... ${FACESHIFT_LIBRARIES}") - endif (NOT FACESHIFT_FIND_QUIETLY) - else () - if (FACESHIFT_FIND_REQUIRED) - message(FATAL_ERROR "Could not find Faceshift") - endif (FACESHIFT_FIND_REQUIRED) - endif () - - # show the FACESHIFT_INCLUDE_DIRS and FACESHIFT_LIBRARIES variables only in the advanced view - mark_as_advanced(FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES) +find_path(FACESHIFT_INCLUDE_DIRS fsbinarystream.h ${FACESHIFT_ROOT_DIR}/include) +if (APPLE) + find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/MacOS/) +elseif (UNIX) + find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/UNIX/) +elseif (WIN32) +# For windows, we're going to build the faceshift sources directly into the interface build +# and not link to a prebuilt library. This is because the VS2010 linker doesn't like cross-linking +# between release and debug libraries. If we change that in the future we can make win32 more +# like the other platforms + #find_library(FACESHIFT_LIBRARIES faceshift.lib ${FACESHIFT_ROOT_DIR}/lib/WIN32/) endif () + +if (WIN32) + # Windows only cares about the headers + if (FACESHIFT_INCLUDE_DIRS) + set(FACESHIFT_FOUND TRUE) + endif (FACESHIFT_INCLUDE_DIRS) +else () + # Mac and Unix requires libraries + if (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) + set(FACESHIFT_FOUND TRUE) + endif (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) +endif () + +if (FACESHIFT_FOUND) + if (NOT FACESHIFT_FIND_QUIETLY) + message(STATUS "Found Faceshift... ${FACESHIFT_LIBRARIES}") + endif (NOT FACESHIFT_FIND_QUIETLY) +else () + if (FACESHIFT_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Faceshift") + endif (FACESHIFT_FIND_REQUIRED) +endif () + +# show the FACESHIFT_INCLUDE_DIRS and FACESHIFT_LIBRARIES variables only in the advanced view +mark_as_advanced(FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES) \ No newline at end of file diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 4ec85c8161..674cbef7a4 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -24,7 +24,7 @@ find_path(LIBOVR_INCLUDE_DIRS OVR.h PATH_SUFFIXES Include HINTS ${LIBOVR_SEARCH_ find_path(LIBOVR_UTIL_INCLUDE_DIR Util_Render_Stereo.h PATH_SUFFIXES Src/Util HINTS ${LIBOVR_SEARCH_DIRS}) # add the util include dir to the general include dirs -set(LIBOVR_INCLUDE_DIRS "${LIBOVR_INCLUDE_DIRS}" "${LIBOVR_UTIL_INCLUDE_DIR}") +set(LIBOVR_INCLUDE_DIRS ${LIBOVR_INCLUDE_DIRS} ${LIBOVR_UTIL_INCLUDE_DIR}) if (APPLE) find_library(LIBOVR_LIBRARY_DEBUG "Lib/MacOS/Debug/libovr.a" HINTS ${LIBOVR_SEARCH_DIRS}) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index e0bd8c1899..201487105d 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -183,7 +183,7 @@ endif (FACEPLUS_FOUND AND NOT DISABLE_FACEPLUS) # and with LibOVR for Oculus Rift if (LIBOVR_FOUND AND NOT DISABLE_LIBOVR) add_definitions(-DHAVE_LIBOVR) - include_directories(SYSTEM "${LIBOVR_INCLUDE_DIRS}") + include_directories(SYSTEM ${LIBOVR_INCLUDE_DIRS}) if (APPLE OR UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${LIBOVR_INCLUDE_DIRS}")