From 05746ed70253afb6b1897ef255f012c609c23503 Mon Sep 17 00:00:00 2001 From: Sergiu Dotenco Date: Mon, 20 Apr 2015 22:51:42 +0200 Subject: [PATCH] cmake: support gflags in static builds --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e694128..cb0b16c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,6 +370,11 @@ endif (HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS) if (gflags_FOUND) target_include_directories (glog PUBLIC ${gflags_INCLUDE_DIR}) target_link_libraries (glog PUBLIC ${gflags_LIBRARIES}) + + if (NOT BUILD_SHARED_LIBS) + # Don't use __declspec(dllexport|dllimport) if this is a static build + targeT_compile_definitions (glog PUBLIC GFLAGS_DLL_DECLARE_FLAG= GFLAGS_DLL_DEFINE_FLAG=) + endif (NOT BUILD_SHARED_LIBS) endif (gflags_FOUND) set_target_properties (glog PROPERTIES VERSION ${GLOG_MAJOR_VERSION}) -- 2.34.1