Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve vrpn/quatlib finders to find the default locations on Windows

  • Loading branch information...
commit 449fe463184ed7124e4e51522d0bbd23de3247f1 1 parent 450a051
Ryan Pavlik authored
Showing with 33 additions and 8 deletions.
  1. +19 −3 FindVRPN.cmake
  2. +14 −5 Findquatlib.cmake
22 FindVRPN.cmake
View
@@ -34,8 +34,18 @@ set(VRPN_ROOT_DIR
if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8")
set(_libsuffixes lib64 lib)
+
+ # 64-bit dir: only set on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles)
else()
set(_libsuffixes lib)
+ if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "")
+ # 32-bit dir: only set on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles)
+ else()
+ # 32-bit dir on win32, useless to us on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles)
+ endif()
endif()
###
@@ -49,7 +59,9 @@ find_path(VRPN_INCLUDE_DIR
include
include/vrpn
HINTS
- "${VRPN_ROOT_DIR}")
+ "${VRPN_ROOT_DIR}"
+ PATHS
+ "${_progfiles}/VRPN")
find_library(VRPN_LIBRARY
NAMES
@@ -57,7 +69,9 @@ find_library(VRPN_LIBRARY
PATH_SUFFIXES
${_libsuffixes}
HINTS
- "${VRPN_ROOT_DIR}")
+ "${VRPN_ROOT_DIR}"
+ PATHS
+ "${_progfiles}/VRPN")
find_library(VRPN_SERVER_LIBRARY
NAMES
@@ -65,7 +79,9 @@ find_library(VRPN_SERVER_LIBRARY
PATH_SUFFIXES
${_libsuffixes}
HINTS
- "${VRPN_ROOT_DIR}")
+ "${VRPN_ROOT_DIR}"
+ PATHS
+ "${_progfiles}/VRPN")
###
# Dependencies
19 Findquatlib.cmake
View
@@ -35,8 +35,18 @@ else()
if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8")
set(_libsuffixes lib64 lib)
+
+ # 64-bit dir: only set on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles)
else()
set(_libsuffixes lib)
+ if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "")
+ # 32-bit dir: only set on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles)
+ else()
+ # 32-bit dir on win32, useless to us on win64
+ file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles)
+ endif()
endif()
# Look for the header file.
@@ -48,8 +58,8 @@ else()
PATH_SUFFIXES
include
PATHS
- "C:/Program Files/quatlib/include"
- "../quat")
+ "${_progfiles}/VRPN"
+ "${_progfiles}/quatlib")
# Look for the library.
find_library(QUATLIB_LIBRARY
@@ -61,9 +71,8 @@ else()
PATH_SUFFIXES
${_libsuffixes}
PATHS
- "C:/Program Files/quatlib/lib"
- "../buildquat"
- "../buildquat/release")
+ "${_progfiles}/VRPN"
+ "${_progfiles}/quatlib")
endif()
# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if
Please sign in to comment.
Something went wrong with that request. Please try again.