diff --git a/cmake/libint2-config.cmake.in b/cmake/libint2-config.cmake.in index 117d372f..ff5a28c1 100644 --- a/cmake/libint2-config.cmake.in +++ b/cmake/libint2-config.cmake.in @@ -59,9 +59,11 @@ include(CMakeFindDependencyMacro) set(Eigen3_CONFIG @Eigen3_CONFIG@) if (NOT Eigen3_CONFIG OR NOT EXISTS ${Eigen3_CONFIG}) message(WARNING "Libint2 library was built with Eigen3Config.cmake detected at ${Eigen3_CONFIG}, but this path is no longer valid; directory moved since Libint2 library build?") + find_dependency(Eigen3 REQUIRED) + else() + get_filename_component(Eigen3_DIR "${Eigen3_CONFIG}" DIRECTORY) + find_dependency(Eigen3 REQUIRED HINTS "${Eigen3_DIR}") endif() - get_filename_component(Eigen3_DIR ${Eigen3_CONFIG} DIRECTORY) - find_dependency(Eigen3 REQUIRED PATHS ${Eigen3_CONFIG}) endif() if (@LIBINT_HAS_SYSTEM_BOOST_PREPROCESSOR_VARIADICS@) # LIBINT_HAS_SYSTEM_BOOST_PREPROCESSOR_VARIADICS @@ -70,9 +72,11 @@ include(CMakeFindDependencyMacro) set(Boost_CONFIG @Boost_CONFIG@) if (NOT Boost_CONFIG OR NOT EXISTS ${Boost_CONFIG}) message(WARNING "Libint2 library was built with BoostConfig.cmake detected at ${Boost_CONFIG}, but this path is no longer valid; directory moved since Libint2 library build?") + find_dependency(Boost 1.57 REQUIRED) + else() + get_filename_component(Boost_DIR "${Boost_CONFIG}" DIRECTORY) + find_dependency(Boost 1.57 REQUIRED HINTS "${Boost_DIR}") endif() - get_filename_component(Boost_DIR ${Boost_CONFIG} DIRECTORY) - find_dependency(Boost 1.57 REQUIRED) endif() else() if(NOT CMAKE_REQUIRED_QUIET)