Skip to content

Commit

Permalink
Try to retain the old behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Sep 2, 2024
1 parent db6b056 commit 5edbfb6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion config/VigraFindPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,24 @@ MACRO(VIGRA_FIND_PACKAGE package)

MESSAGE(STATUS "Searching for ${package}${VERSION_MESSAGE}")

FIND_PACKAGE(${package} ${VERSION_SPEC} ${COMPONENTS})
SET(OLD_CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH})
SET(OLD_CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
foreach(path ${DEPENDENCY_SEARCH_PREFIX})
if(NOT ${package}_FOUND)
SET(CMAKE_INCLUDE_PATH ${path}/include)
SET(CMAKE_LIBRARY_PATH ${path}/lib)

# SET(${package}_INCLUDE_DIR ${package}_INCLUDE_DIR-NOTFOUND)
# SET(${package}_LIBRARIES ${package}_LIBRARIES-NOTFOUND)
# SET(${package}_LIBRARY ${package}_LIBRARY-NOTFOUND)
MESSAGE(STATUS " in prefix ${path}")
FIND_PACKAGE(${package} ${VERSION_SPEC} ${COMPONENTS})

endif()
endforeach(path)

SET(CMAKE_INCLUDE_PATH ${OLD_CMAKE_INCLUDE_PATH})
SET(CMAKE_LIBRARY_PATH ${OLD_CMAKE_LIBRARY_PATH})

# search the package in the default locations if not found
# in the DEPENDENCY_SEARCH_PREFIX
Expand Down

0 comments on commit 5edbfb6

Please sign in to comment.