From e1cae334a198010b7c4642dfb578552d2bf15adc Mon Sep 17 00:00:00 2001 From: Brian Orr Date: Thu, 22 Jun 2017 00:25:13 -0700 Subject: [PATCH 1/2] Use gflags ALIAS instead of ${gflags_XXX} vars The gflags project updated their CMake config last year with a `gflags` ALIAS target. This can be used instead of the legacy `${gflags_LIBRARIES}` and `${gflags_INCLUDE_DIRS}` variables. It also looks cleaner. Fixes #198 --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7415eab..9852df1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -397,8 +397,7 @@ if (WIN32 AND HAVE_SNPRINTF) endif (WIN32 AND HAVE_SNPRINTF) if (gflags_FOUND) - target_include_directories (glog PUBLIC $) - target_link_libraries (glog PUBLIC ${gflags_LIBRARIES}) + target_link_libraries (glog PUBLIC gflags) if (NOT BUILD_SHARED_LIBS) # Don't use __declspec(dllexport|dllimport) if this is a static build From baf6c8b2c5712f70e20a3fc4734267b7c7cbf8b0 Mon Sep 17 00:00:00 2001 From: Brian Orr Date: Thu, 22 Jun 2017 11:24:58 -0700 Subject: [PATCH 2/2] Specify gflags version in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9852df1..127c6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ include (DetermineGflagsNamespace) set (CMAKE_THREAD_PREFER_PTHREAD 1) if (WITH_GFLAGS) - find_package (gflags) + find_package (gflags 2.2.0) if (gflags_FOUND) set (HAVE_LIB_GFLAGS 1)