diff --git a/CMakeLists.txt b/CMakeLists.txt index da40af5..1664009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,10 +90,10 @@ include(${CMAKE_BINARY_DIR}/HunterSetup.cmake) file(WRITE ${CMAKE_BINARY_DIR}/HunterToolchain.cmake.in [=[ # Add hunter install directory to the find_package variables -if (EXISTS "${CMAKE_BINARY_DIR}/_3rdParty/Hunter/install-root-dir") - file(READ ${CMAKE_BINARY_DIR}/_3rdParty/Hunter/install-root-dir HunterInstall) - list(APPEND CMAKE_FIND_ROOT_PATH \"${HunterInstall}\") - list(APPEND CMAKE_PREFIX_PATH \"${HunterInstall}\") +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/_3rdParty/Hunter/install-root-dir") + file(READ "${CMAKE_CURRENT_LIST_DIR}/_3rdParty/Hunter/install-root-dir" HunterInstall) + list(APPEND CMAKE_FIND_ROOT_PATH "${HunterInstall}") + list(APPEND CMAKE_PREFIX_PATH "${HunterInstall}") endif() ]=])