Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 97 lines 3.1 kB view raw
1From 38b81bb53304d7a3f6aed36f7b4e77b6efa78338 Mon Sep 17 00:00:00 2001 2From: uku <hi@uku.moe> 3Date: Wed, 14 May 2025 16:55:15 +0200 4Subject: [PATCH] fix linking against glog 0.7.x 5 6--- 7 cmake/Dependencies.cmake | 2 +- 8 cmake/External/glog.cmake | 4 +-- 9 cmake/Modules/FindGlog.cmake | 48 ------------------------------------ 10 3 files changed, 3 insertions(+), 51 deletions(-) 11 delete mode 100644 cmake/Modules/FindGlog.cmake 12 13diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake 14index 4a5bac47..88aa123f 100644 15--- a/cmake/Dependencies.cmake 16+++ b/cmake/Dependencies.cmake 17@@ -32,7 +32,7 @@ endif() 18 # ---[ Google-glog 19 include("cmake/External/glog.cmake") 20 list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${GLOG_INCLUDE_DIRS}) 21-list(APPEND Caffe_LINKER_LIBS PUBLIC ${GLOG_LIBRARIES}) 22+list(APPEND Caffe_LINKER_LIBS PUBLIC glog::glog) 23 24 # ---[ Google-gflags 25 include("cmake/External/gflags.cmake") 26diff --git a/cmake/External/glog.cmake b/cmake/External/glog.cmake 27index f9d0549c..43414544 100644 28--- a/cmake/External/glog.cmake 29+++ b/cmake/External/glog.cmake 30@@ -5,8 +5,8 @@ if (NOT __GLOG_INCLUDED) 31 set(__GLOG_INCLUDED TRUE) 32 33 # try the system-wide glog first 34- find_package(Glog) 35- if (GLOG_FOUND) 36+ find_package(glog REQUIRED) 37+ if (glog_FOUND) 38 set(GLOG_EXTERNAL FALSE) 39 else() 40 # fetch and build glog from github 41diff --git a/cmake/Modules/FindGlog.cmake b/cmake/Modules/FindGlog.cmake 42deleted file mode 100644 43index 99abbe47..00000000 44--- a/cmake/Modules/FindGlog.cmake 45+++ /dev/null 46@@ -1,48 +0,0 @@ 47-# - Try to find Glog 48-# 49-# The following variables are optionally searched for defaults 50-# GLOG_ROOT_DIR: Base directory where all GLOG components are found 51-# 52-# The following are set after configuration is done: 53-# GLOG_FOUND 54-# GLOG_INCLUDE_DIRS 55-# GLOG_LIBRARIES 56-# GLOG_LIBRARYRARY_DIRS 57- 58-include(FindPackageHandleStandardArgs) 59- 60-set(GLOG_ROOT_DIR "" CACHE PATH "Folder contains Google glog") 61- 62-if(WIN32) 63- find_path(GLOG_INCLUDE_DIR glog/logging.h 64- PATHS ${GLOG_ROOT_DIR}/src/windows) 65-else() 66- find_path(GLOG_INCLUDE_DIR glog/logging.h 67- PATHS ${GLOG_ROOT_DIR}) 68-endif() 69- 70-if(MSVC) 71- find_library(GLOG_LIBRARY_RELEASE libglog_static 72- PATHS ${GLOG_ROOT_DIR} 73- PATH_SUFFIXES Release) 74- 75- find_library(GLOG_LIBRARY_DEBUG libglog_static 76- PATHS ${GLOG_ROOT_DIR} 77- PATH_SUFFIXES Debug) 78- 79- set(GLOG_LIBRARY optimized ${GLOG_LIBRARY_RELEASE} debug ${GLOG_LIBRARY_DEBUG}) 80-else() 81- find_library(GLOG_LIBRARY glog 82- PATHS ${GLOG_ROOT_DIR} 83- PATH_SUFFIXES lib lib64) 84-endif() 85- 86-find_package_handle_standard_args(Glog DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARY) 87- 88-if(GLOG_FOUND) 89- set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) 90- set(GLOG_LIBRARIES ${GLOG_LIBRARY}) 91- message(STATUS "Found glog (include: ${GLOG_INCLUDE_DIR}, library: ${GLOG_LIBRARY})") 92- mark_as_advanced(GLOG_ROOT_DIR GLOG_LIBRARY_RELEASE GLOG_LIBRARY_DEBUG 93- GLOG_LIBRARY GLOG_INCLUDE_DIR) 94-endif() 95-- 962.49.0 97