Use CMake HINTS to override dependency locations

- fix cmake modules to search explicit locations ahead of default system paths

fixes #388
This commit is contained in:
manuelk 2015-02-10 13:13:39 -08:00
parent 5d868200db
commit fcf01afb19
3 changed files with 28 additions and 16 deletions

View File

@ -37,9 +37,10 @@ if (WIN32)
find_path(GLEW_INCLUDE_DIR
NAMES
GL/glew.h
PATHS
HINTS
"${GLEW_LOCATION}/include"
"$ENV{GLEW_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/GLEW/include"
"${PROJECT_SOURCE_DIR}/extern/glew/include"
DOC "The directory where GL/glew.h resides" )
@ -53,9 +54,10 @@ if (WIN32)
find_library(GLEW_LIBRARY
NAMES
glew GLEW glew32s glew32
PATHS
HINTS
"${GLEW_LOCATION}/lib"
"$ENV{GLEW_LOCATION}/lib"
PATHS
"$ENV{PROGRAMFILES}/GLEW/lib"
"${PROJECT_SOURCE_DIR}/extern/glew/bin"
"${PROJECT_SOURCE_DIR}/extern/glew/lib"
@ -68,9 +70,10 @@ if (${CMAKE_HOST_UNIX})
find_path( GLEW_INCLUDE_DIR
NAMES
GL/glew.h
PATHS
HINTS
"${GLEW_LOCATION}/include"
"$ENV{GLEW_LOCATION}/include"
PATHS
/usr/include
/usr/local/include
/sw/include
@ -81,9 +84,10 @@ if (${CMAKE_HOST_UNIX})
find_library( GLEW_LIBRARY
NAMES
GLEW glew
PATHS
HINTS
"${GLEW_LOCATION}/lib"
"$ENV{GLEW_LOCATION}/lib"
PATHS
/usr/lib64
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}

View File

@ -34,9 +34,10 @@ find_path( GLFW_INCLUDE_DIR
NAMES
GL/glfw.h
GLFW/glfw3.h
PATHS
HINTS
"${GLFW_LOCATION}/include"
"$ENV{GLFW_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/GLFW/include"
"${OPENGL_INCLUDE_DIR}"
/usr/openwin/share/include
@ -57,10 +58,11 @@ if (WIN32)
find_library( GLFW_glfw_LIBRARY
NAMES
glfw32
PATHS
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x64"
"$ENV{GLFW_LOCATION}/lib"
PATHS
"${OPENGL_LIBRARY_DIR}"
/usr/lib
/usr/lib/w32api
@ -76,7 +78,7 @@ if (WIN32)
glfw32s
glfw
glfw3
PATHS
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x64"
"${GLFW_LOCATION}/lib-msvc110"
@ -85,8 +87,7 @@ if (WIN32)
"$ENV{GLFW_LOCATION}/lib/x64"
"$ENV{GLFW_LOCATION}/lib-msvc110"
"$ENV{GLFW_LOCATION}/lib-vc2012"
"${PROJECT_SOURCE_DIR}/extern/glfw/bin"
"${PROJECT_SOURCE_DIR}/extern/glfw/lib"
PATHS
"$ENV{PROGRAMFILES}/GLFW/lib"
"${OPENGL_LIBRARY_DIR}"
DOC
@ -99,11 +100,12 @@ else ()
NAMES
glfw
glfw3
PATHS
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/cocoa"
"$ENV{GLFW_LOCATION}/lib"
"$ENV{GLFW_LOCATION}/lib/cocoa"
PATHS
/usr/local/lib
)
set(GLFW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
@ -134,11 +136,12 @@ else ()
NAMES
glfw
glfw3
PATHS
HINTS
"${GLFW_LOCATION}/lib"
"$ENV{GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x11"
"$ENV{GLFW_LOCATION}/lib/x11"
PATHS
/usr/lib64
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}

View File

@ -34,18 +34,20 @@ if (WIN32)
find_path( PTEX_INCLUDE_DIR
NAMES
Ptexture.h
PATHS
HINTS
"${PTEX_LOCATION}/include"
"$ENV{PTEX_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/Ptex/include"
/usr/include
DOC "The directory where Ptexture.h resides")
find_library( PTEX_LIBRARY
NAMES
Ptex32 Ptex32s Ptex
PATHS
HINTS
"${PTEX_LOCATION}/lib"
"$ENV{PTEX_LOCATION}/lib"
PATHS
"$ENV{PROGRAMFILES}/Ptex/lib"
/usr/lib
/usr/lib/w32api
@ -56,9 +58,10 @@ elseif (APPLE)
find_path( PTEX_INCLUDE_DIR
NAMES
Ptexture.h
PATHS
HINTS
"${PTEX_LOCATION}/include"
"$ENV{PTEX_LOCATION}/include"
PATHS
DOC "The directory where Ptexture.h resides")
find_library( PTEX_LIBRARY
NAMES
@ -71,11 +74,12 @@ else ()
find_path( PTEX_INCLUDE_DIR
NAMES
Ptexture.h
PATHS
HINTS
"${PTEX_LOCATION}/include"
"${PTEX_LOCATION}/include/wdas"
"$ENV{PTEX_LOCATION}/include"
"$ENV{PTEX_LOCATION}/include/wdas"
PATHS
/usr/include
/usr/local/include
/usr/openwin/share/include
@ -86,9 +90,10 @@ else ()
find_library( PTEX_LIBRARY
NAMES
Ptex wdasPtex
PATHS
HINTS
"${PTEX_LOCATION}/lib"
"$ENV{PTEX_LOCATION}/lib"
PATHS
/usr/lib
/usr/local/lib
/usr/openwin/lib