From 21f4e87c518538d0c22f913963d14123d0d29075 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 24 Jul 2014 14:48:28 -0700 Subject: [PATCH] cleanup HifiLibrarySearchHints cmake macro --- cmake/macros/HifiLibrarySearchHints.cmake | 5 +++-- cmake/modules/FindFaceshift.cmake | 4 ++-- cmake/modules/FindGLEW.cmake | 10 +++++----- cmake/modules/FindGLM.cmake | 4 ++-- cmake/modules/FindGLUT.cmake | 18 +++++++++--------- cmake/modules/FindLeapMotion.cmake | 4 ++-- cmake/modules/FindLibOVR.cmake | 20 ++++++++++---------- cmake/modules/FindOpenSSL.cmake | 4 ++-- cmake/modules/FindQxmpp.cmake | 4 ++-- cmake/modules/FindRtMidi.cmake | 4 ++-- cmake/modules/FindSixense.cmake | 4 ++-- cmake/modules/FindVisage.cmake | 4 ++-- 12 files changed, 43 insertions(+), 42 deletions(-) diff --git a/cmake/macros/HifiLibrarySearchHints.cmake b/cmake/macros/HifiLibrarySearchHints.cmake index c784e2da4a..f56b3134d8 100644 --- a/cmake/macros/HifiLibrarySearchHints.cmake +++ b/cmake/macros/HifiLibrarySearchHints.cmake @@ -8,7 +8,8 @@ # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # -macro(HIFI_LIBRARY_SEARCH_HINTS LIBRARY_PREFIX LIBRARY_FOLDER) +macro(HIFI_LIBRARY_SEARCH_HINTS LIBRARY_FOLDER) + string(TOUPPER ${LIBRARY_FOLDER} LIBRARY_PREFIX) set(${LIBRARY_PREFIX}_SEARCH_DIRS "") if (${LIBRARY_PREFIX}_ROOT_DIR) @@ -23,4 +24,4 @@ macro(HIFI_LIBRARY_SEARCH_HINTS LIBRARY_PREFIX LIBRARY_FOLDER) set(${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_SEARCH_DIRS}" "$ENV{HIFI_LIB_DIR}/${LIBRARY_FOLDER}") endif () -endmacro(HIFI_LIBRARY_SEARCH_HINTS _library_prefix _library_folder) \ No newline at end of file +endmacro(HIFI_LIBRARY_SEARCH_HINTS _library_folder) \ No newline at end of file diff --git a/cmake/modules/FindFaceshift.cmake b/cmake/modules/FindFaceshift.cmake index e44f686d82..2641475fa3 100644 --- a/cmake/modules/FindFaceshift.cmake +++ b/cmake/modules/FindFaceshift.cmake @@ -19,7 +19,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("FACESHIFT" "faceshift") +hifi_library_search_hints("faceshift") find_path(FACESHIFT_INCLUDE_DIRS fsbinarystream.h PATH_SUFFIXES include HINTS ${FACESHIFT_SEARCH_DIRS}) @@ -42,4 +42,4 @@ set(FACESHIFT_LIBRARIES ${FACESHIFT_LIBRARY}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FACESHIFT DEFAULT_MSG FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES) -mark_as_advanced(FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES) \ No newline at end of file +mark_as_advanced(FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES FACESHIFT_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index 0ffe8c433d..99d6dfc003 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -20,12 +20,12 @@ if (WIN32) include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") - hifi_library_search_hints("GLEW" "glew") + hifi_library_search_hints("glew") - find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS}) + find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${GLEW_SEARCH_DIRS}) - find_library(GLEW_LIBRARY_RELEASE glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS}) - find_library(GLEW_LIBRARY_DEBUG glew32s PATH_SUFFIXES "lib/Debug/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS}) + find_library(GLEW_LIBRARY_RELEASE glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${GLEW_SEARCH_DIRS}) + find_library(GLEW_LIBRARY_DEBUG glew32s PATH_SUFFIXES "lib/Debug/Win32" "lib" HINTS ${GLEW_SEARCH_DIRS}) include(SelectLibraryConfigurations) select_library_configurations(GLEW) @@ -36,4 +36,4 @@ set(GLEW_LIBRARIES "${GLEW_LIBRARY}") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARIES) -mark_as_advanced(GLEW_INCLUDE_DIRS GLEW_LIBRARIES) \ No newline at end of file +mark_as_advanced(GLEW_INCLUDE_DIRS GLEW_LIBRARIES GLEW_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindGLM.cmake b/cmake/modules/FindGLM.cmake index 0c4c596834..ae9a1bc23f 100644 --- a/cmake/modules/FindGLM.cmake +++ b/cmake/modules/FindGLM.cmake @@ -15,7 +15,7 @@ # setup hints for GLM search include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("GLM" "glm") +hifi_library_search_hints("glm") # locate header find_path(GLM_INCLUDE_DIR "glm/glm.hpp" HINTS ${GLM_HEADER_SEARCH_HINTS}) @@ -24,4 +24,4 @@ set(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLM DEFAULT_MSG GLM_INCLUDE_DIRS) -mark_as_advanced(GLM_INCLUDE_DIRS) \ No newline at end of file +mark_as_advanced(GLM_INCLUDE_DIRS GLM_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index 5a78ddd589..36560b4e17 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -19,16 +19,16 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("GLUT" "freeglut") +hifi_library_search_hints("freeglut") if (WIN32) - set(GLUT_HINT_DIRS "${GLUT_HINT_DIRS} ${OPENGL_INCLUDE_DIR}")s + set(GLUT_HINT_DIRS "${FREEGLUT_SEARCH_DIRS} ${OPENGL_INCLUDE_DIR}")s - find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${GLUT_HINT_DIRS}) - find_library(GLUT_LIBRARY freeglut PATH_SUFFIXES lib HINTS ${GLUT_HINT_DIRS}) + find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS}) + find_library(GLUT_LIBRARY freeglut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) else () - find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${GLUT_HINT_DIRS}) - find_library(GLUT_LIBRARY glut PATH_SUFFIXES lib HINTS ${GLUT_HINT_DIRS}) + find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS}) + find_library(GLUT_LIBRARY glut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) endif () include(FindPackageHandleStandardArgs) @@ -36,12 +36,12 @@ include(FindPackageHandleStandardArgs) set(GLUT_LIBRARIES "${GLUT_LIBRARY}" "${XMU_LIBRARY}" "${XI_LIBRARY}") if (UNIX) - find_library(XI_LIBRARY Xi PATH_SUFFIXES lib HINTS ${GLUT_HINT_DIRS}) - find_library(XMU_LIBRARY Xmu PATH_SUFFIXES lib HINTS ${GLUT_HINT_DIRS}) + find_library(XI_LIBRARY Xi PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) + find_library(XMU_LIBRARY Xmu PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES XI_LIBRARY XMU_LIBRARY) else () find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES) endif () -mark_as_advanced(GLUT_INCLUDE_DIRS GLUT_LIBRARIES GLUT_LIBRARY XI_LIBRARY XMU_LIBRARY) \ No newline at end of file +mark_as_advanced(GLUT_INCLUDE_DIRS GLUT_LIBRARIES GLUT_LIBRARY XI_LIBRARY XMU_LIBRARY FREEGLUT_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindLeapMotion.cmake b/cmake/modules/FindLeapMotion.cmake index 1b8e6eae11..85ce870b96 100644 --- a/cmake/modules/FindLeapMotion.cmake +++ b/cmake/modules/FindLeapMotion.cmake @@ -13,7 +13,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("LEAPMOTION" "leapmotion") +hifi_library_search_hints("leapmotion") find_path(LEAPMOTION_INCLUDE_DIRS Leap.h PATH_SUFFIXES include HINTS ${LEAPMOTION_SEARCH_DIRS}) @@ -32,4 +32,4 @@ set(LEAPMOTION_LIBRARIES "${LEAPMOTION_LIBRARY}") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LEAPMOTION DEFAULT_MSG LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES) -mark_as_advanced(LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES) +mark_as_advanced(LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES LEAPMOTION_SEARCH_DIRS) diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 82baa41ee4..786a24a06b 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -19,10 +19,10 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("LIBOVR" "oculus") +hifi_library_search_hints("oculus") -find_path(LIBOVR_INCLUDE_DIRS OVR.h PATH_SUFFIXES Include HINTS ${LIBOVR_SEARCH_DIRS}) -find_path(LIBOVR_UTIL_INCLUDE_DIR Util_Render_Stereo.h PATH_SUFFIXES Src/Util HINTS ${LIBOVR_SEARCH_DIRS}) +find_path(LIBOVR_INCLUDE_DIRS OVR.h PATH_SUFFIXES Include HINTS ${OCULUS_SEARCH_DIRS}) +find_path(LIBOVR_UTIL_INCLUDE_DIR Util_Render_Stereo.h PATH_SUFFIXES Src/Util HINTS ${OCULUS_SEARCH_DIRS}) # add the util include dir to the general include dirs set(LIBOVR_INCLUDE_DIRS "${LIBOVR_INCLUDE_DIRS}" "${LIBOVR_UTIL_INCLUDE_DIR}") @@ -30,8 +30,8 @@ set(LIBOVR_INCLUDE_DIRS "${LIBOVR_INCLUDE_DIRS}" "${LIBOVR_UTIL_INCLUDE_DIR}") include(SelectLibraryConfigurations) if (APPLE) - find_library(LIBOVR_LIBRARY_DEBUG "Lib/MacOS/Debug/libovr.a" HINTS ${LIBOVR_SEARCH_DIRS}) - find_library(LIBOVR_LIBRARY_RELEASE "Lib/MacOS/Release/libovr.a" HINTS ${LIBOVR_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_DEBUG "Lib/MacOS/Debug/libovr.a" HINTS ${OCULUS_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_RELEASE "Lib/MacOS/Release/libovr.a" HINTS ${OCULUS_SEARCH_DIRS}) elseif (UNIX) find_library(UDEV_LIBRARY_RELEASE udev /usr/lib/x86_64-linux-gnu/) find_library(XINERAMA_LIBRARY_RELEASE Xinerama /usr/lib/x86_64-linux-gnu/) @@ -42,15 +42,15 @@ elseif (UNIX) set(LINUX_ARCH_DIR "x86_64") endif() - find_library(LIBOVR_LIBRARY_DEBUG "Lib/Linux/Debug/${LINUX_ARCH_DIR}/libovr.a" HINTS ${LIBOVR_SEARCH_DIRS}) - find_library(LIBOVR_LIBRARY_RELEASE "Lib/Linux/Release/${LINUX_ARCH_DIR}/libovr.a" HINTS ${LIBOVR_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_DEBUG "Lib/Linux/Debug/${LINUX_ARCH_DIR}/libovr.a" HINTS ${OCULUS_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_RELEASE "Lib/Linux/Release/${LINUX_ARCH_DIR}/libovr.a" HINTS ${OCULUS_SEARCH_DIRS}) select_library_configurations(UDEV) select_library_configurations(XINERAMA) elseif (WIN32) - find_library(LIBOVR_LIBRARY_DEBUG "Lib/Win32/libovrd.lib" HINTS ${LIBOVR_SEARCH_DIRS}) - find_library(LIBOVR_LIBRARY_RELEASE "Lib/Win32/libovr.lib" HINTS ${LIBOVR_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_DEBUG "Lib/Win32/libovrd.lib" HINTS ${OCULUS_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARY_RELEASE "Lib/Win32/libovr.lib" HINTS ${OCULUS_SEARCH_DIRS}) endif () select_library_configurations(LIBOVR) @@ -64,4 +64,4 @@ elseif () find_package_handle_standard_args(LIBOVR DEFAULT_MSG LIBOVR_INCLUDE_DIRS LIBOVR_UTIL_INCLUDE_DIR LIBOVR_LIBRARIES UDEV_LIBRARY XINERAMA_LIBRARY) endif () -mark_as_advanced(LIBOVR_INCLUDE_DIRS LIBOVR_LIBRARIES) +mark_as_advanced(LIBOVR_INCLUDE_DIRS LIBOVR_LIBRARIES OCULUS_SEARCH_DIRS) diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake index 5b398c2329..16db0a16f0 100644 --- a/cmake/modules/FindOpenSSL.cmake +++ b/cmake/modules/FindOpenSSL.cmake @@ -47,7 +47,7 @@ if (WIN32) set(_OPENSSL_ROOT_HINTS_AND_PATHS HINTS ${_OPENSSL_ROOT_HINTS} PATHS ${_OPENSSL_ROOT_PATHS}) else () include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") - hifi_library_search_hints("OPENSSL" "openssl") + hifi_library_search_hints("openssl") set(_OPENSSL_ROOT_HINTS_AND_PATHS ${OPENSSL_SEARCH_DIRS}) endif () @@ -231,4 +231,4 @@ else () ) endif () -mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) +mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES OPENSSL_SEARCH_DIRS) diff --git a/cmake/modules/FindQxmpp.cmake b/cmake/modules/FindQxmpp.cmake index 02340941fc..e5b6e6506a 100644 --- a/cmake/modules/FindQxmpp.cmake +++ b/cmake/modules/FindQxmpp.cmake @@ -19,7 +19,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("QXMPP" "qxmpp") +hifi_library_search_hints("qxmpp") find_path(QXMPP_INCLUDE_DIRS QXmppClient.h PATH_SUFFIXES include/qxmpp HINTS ${QXMPP_SEARCH_DIRS}) @@ -34,4 +34,4 @@ set(QXMPP_LIBRARIES "${QXMPP_LIBRARY}") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(QXMPP DEFAULT_MSG QXMPP_INCLUDE_DIRS QXMPP_LIBRARIES) -mark_as_advanced(QXMPP_INCLUDE_DIRS QXMPP_LIBRARIES) \ No newline at end of file +mark_as_advanced(QXMPP_INCLUDE_DIRS QXMPP_LIBRARIES QXMPP_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindRtMidi.cmake b/cmake/modules/FindRtMidi.cmake index b52ab7b23a..93f1cc69cc 100644 --- a/cmake/modules/FindRtMidi.cmake +++ b/cmake/modules/FindRtMidi.cmake @@ -19,7 +19,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("RTMIDI" "rtmidi") +hifi_library_search_hints("rtmidi") find_path(RTMIDI_INCLUDE_DIRS RtMidi.h PATH_SUFFIXES include HINTS ${RTMIDI_SEARCH_DIRS}) find_library(RTMIDI_LIBRARIES NAMES rtmidi PATH_SUFFIXES lib HINTS ${RTMIDI_SEARCH_DIRS}) @@ -27,4 +27,4 @@ find_library(RTMIDI_LIBRARIES NAMES rtmidi PATH_SUFFIXES lib HINTS ${RTMIDI_SEAR include(FindPackageHandleStandardArgs) find_package_handle_standard_args(RTMIDI DEFAULT_MSG RTMIDI_INCLUDE_DIRS RTMIDI_LIBRARIES) -mark_as_advanced(RTMIDI_INCLUDE_DIRS RTMIDI_LIBRARIES) \ No newline at end of file +mark_as_advanced(RTMIDI_INCLUDE_DIRS RTMIDI_LIBRARIES RTMIDI_SEARCH_DIRS) \ No newline at end of file diff --git a/cmake/modules/FindSixense.cmake b/cmake/modules/FindSixense.cmake index 18eaf0409f..a24131698b 100644 --- a/cmake/modules/FindSixense.cmake +++ b/cmake/modules/FindSixense.cmake @@ -19,7 +19,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("SIXENSE" "sixense") +hifi_library_search_hints("sixense") find_path(SIXENSE_INCLUDE_DIRS sixense.h PATH_SUFFIXES include HINTS ${SIXENSE_SEARCH_DIRS}) @@ -42,4 +42,4 @@ set(SIXENSE_LIBRARIES "${SIXENSE_LIBRARY}") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(SIXENSE DEFAULT_MSG SIXENSE_INCLUDE_DIRS SIXENSE_LIBRARIES) -mark_as_advanced(SIXENSE_LIBRARIES SIXENSE_INCLUDE_DIRS) +mark_as_advanced(SIXENSE_LIBRARIES SIXENSE_INCLUDE_DIRS SIXENSE_SEARCH_DIRS) diff --git a/cmake/modules/FindVisage.cmake b/cmake/modules/FindVisage.cmake index 2d968184cf..b461926604 100644 --- a/cmake/modules/FindVisage.cmake +++ b/cmake/modules/FindVisage.cmake @@ -19,7 +19,7 @@ # include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("VISAGE" "visage") +hifi_library_search_hints("visage") find_path(VISAGE_BASE_INCLUDE_DIR VisageTracker2.h PATH_SUFFIXES include HINTS ${VISAGE_SEARCH_DIRS}) @@ -54,5 +54,5 @@ set(VISAGE_LIBRARIES "${VISAGE_CORE_LIBRARY}" "${VISAGE_VISION_LIBRARY}" "${VISA mark_as_advanced( VISAGE_INCLUDE_DIRS VISAGE_LIBRARIES VISAGE_BASE_INCLUDE_DIR VISAGE_XML_INCLUDE_DIR VISAGE_OPENCV_INCLUDE_DIR VISAGE_OPENCV2_INCLUDE_DIR - VISAGE_CORE_LIBRARY VISAGE_VISION_LIBRARY VISAGE_OPENCV_LIBRARY + VISAGE_CORE_LIBRARY VISAGE_VISION_LIBRARY VISAGE_OPENCV_LIBRARY VISAGE_SEARCH_DIRS )