From 1bd3529395e77598bf4c565d731167e4443216cb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 7 Mar 2014 13:59:50 -0800 Subject: [PATCH] more module fixes and sixense readme change for OS X dylib --- cmake/modules/FindGLEW.cmake | 9 +++++++-- cmake/modules/FindGLUT.cmake | 9 +++++++-- cmake/modules/FindLibOVR.cmake | 2 +- cmake/modules/FindSixense.cmake | 2 +- interface/external/sixense/readme.txt | 2 -- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index 0d1ea51a81..e086b799c5 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -13,7 +13,7 @@ # Adapted from FindGLEW.cmake available in the nvidia-texture-tools repository # (https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/cmake/FindGLEW.cmake?r=96) -if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARY) +if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARY AND (NOT WIN32 OR GLEW_WIN_DLL)) set(GLEW_FOUND TRUE) else () if (WIN32) @@ -32,7 +32,12 @@ else () endif () include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY) + + if (WIN32) + find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY GLEW_WIN_DLL) + else () + find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY) + endif() if (GLEW_FOUND) if (NOT GLEW_FIND_QUIETLY) diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index 930d283986..a1045505d1 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -11,7 +11,7 @@ # Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository # https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake -if (GLUT_INCLUDE_DIR AND GLUT_LIBRARIES) +if (GLUT_INCLUDE_DIR AND GLUT_LIBRARIES AND (NOT WIN32 OR GLUT_WIN_DLL)) set(GLUT_FOUND TRUE) else () if (WIN32) @@ -71,7 +71,12 @@ else () endif () include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES) + + if (WIN32) + find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES GLUT_WIN_DLL) + else () + find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES) + endif() if (GLUT_FOUND) if (NOT GLUT_FIND_QUIETLY) diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 288dd7e3fd..caabda65db 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -18,7 +18,7 @@ if (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) else (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) set(LIBOVR_SEARCH_DIRS "${LIBOVR_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/oculus") - find_path(LIBOVR_INCLUDE_DIRS Include/OVR.h HINTS ${LIBOVR_SEARCH_DIRS}) + find_path(LIBOVR_INCLUDE_DIRS OVR.h PATH_SUFFIXES Include HINTS ${LIBOVR_SEARCH_DIRS}) if (APPLE) diff --git a/cmake/modules/FindSixense.cmake b/cmake/modules/FindSixense.cmake index 08c98a02b5..d93e5672cb 100644 --- a/cmake/modules/FindSixense.cmake +++ b/cmake/modules/FindSixense.cmake @@ -19,7 +19,7 @@ else () set(SIXENSE_SEARCH_DIRS "${SIXENSE_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/sixense") - find_path(SIXENSE_INCLUDE_DIRS include/sixense.h HINTS ${SIXENSE_SEARCH_DIRS}) + find_path(SIXENSE_INCLUDE_DIRS sixense.h PATH_SUFFIXES include HINTS ${SIXENSE_SEARCH_DIRS}) if (APPLE) find_library(SIXENSE_LIBRARIES lib/osx_x64/release_dll/libsixense_x64.dylib HINTS ${SIXENSE_SEARCH_DIRS}) diff --git a/interface/external/sixense/readme.txt b/interface/external/sixense/readme.txt index a52a1a4d74..c2f3308c61 100644 --- a/interface/external/sixense/readme.txt +++ b/interface/external/sixense/readme.txt @@ -9,6 +9,4 @@ NOTE: Without doing step 2, you will crash at program start time. You may optionally choose to copy the SDK folders to a location outside the repository (so you can re-use with different checkouts and different projects). If so our CMake find module expects you to set the ENV variable 'HIFI_LIB_DIR' to a directory containing a subfolder 'sixense' that contains the folders mentioned above. -2. IMPORTANT: Copy the file interface/external/Sixense/lib/osx_x64/release_dll/libsixense_x64.dylib to /usr/lib - 3. Delete your build directory, run cmake and build, and you should be all set.