From d141c90875c7b4b0c638681a1a75314fc4369aaf Mon Sep 17 00:00:00 2001 From: Guillaume PIERRE Date: Tue, 8 Nov 2022 13:29:08 +0100 Subject: [PATCH] Forbidding find_package() to search for some packages in Windows' registry On Windows, when configuring "glog" or "gflags", a path to -config.cmake is stored under the form of a registry key (HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\). A a consequence, when deploying/installing another version of antares-deps, supposed to be completely independent, an already compiled package ("glog" or "gflags") is found by the find_package() in the Windows registry. As we can't make packages "glog" or "gflags" not to store paths in the Windows' registry, we tell find_package() not to search in registry, by using NO_CMAKE_PACKAGE_REGISTRY option. --- cmake/dependencies/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index 9a44ece..42c975c 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -95,7 +95,14 @@ endif() ## GFLAGS ## ############## if(BUILD_gflags) - find_package(gflags) + # On Windows, when configuring "glog" or "gflags", a path to -config.cmake is stored + # under the form of a registry key (HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\). + # A a consequence, when deploying/installing another version of antares-deps, supposed to be + # completely independent, an already compiled package ("glog" or "gflags") is found by the + # find_package() in the Windows registry. + # As we can't make packages "glog" or "gflags" not to store paths in the Windows' registry, + # we tell find_package() not to search in registry, by using NO_CMAKE_PACKAGE_REGISTRY option. + find_package(gflags NO_CMAKE_PACKAGE_REGISTRY) if(NOT gflags_FOUND) build_git_dependency( @@ -118,7 +125,7 @@ endif() ## GLOG ## ############ if(BUILD_glog) - find_package(glog) + find_package(glog NO_CMAKE_PACKAGE_REGISTRY) if(NOT glog_FOUND) build_git_dependency(