include (DetermineGflagsNamespace)
include (GNUInstallDirs)
+set (CMAKE_DEBUG_POSTFIX d)
set (CMAKE_THREAD_PREFER_PTHREAD 1)
if (WITH_GFLAGS)
check_include_file (ucontext.h HAVE_UCONTEXT_H)
check_include_file (unistd.h HAVE_UNISTD_H)
check_include_file (unwind.h HAVE_UNWIND_H)
+check_include_file (pwd.h HAVE_PWD_H)
check_include_file_cxx ("ext/hash_map" HAVE_EXT_HASH_MAP)
check_include_file_cxx ("ext/hash_set" HAVE_EXT_HASH_SET)
set (CMAKE_VISIBILITY_INLINES_HIDDEN 1)
set (GLOG_PUBLIC_H
- ${CMAKE_CURRENT_BINARY_DIR}/config.h
${CMAKE_CURRENT_BINARY_DIR}/glog/logging.h
${CMAKE_CURRENT_BINARY_DIR}/glog/raw_logging.h
${CMAKE_CURRENT_BINARY_DIR}/glog/stl_logging.h
LIBRARY DESTINATION ${_glog_CMake_LIBDIR}
ARCHIVE DESTINATION ${_glog_CMake_LIBDIR})
+set (glog_POLICY_VERSION 3.0)
+
if (gflags_FOUND)
- set (gflags_DEPENDENCY "find_dependency (gflags ${gflags_VERSION})")
+ # Ensure clients locate only the package config and not third party find
+ # modules having the same name. This avoid cmake_policy PUSH/POP errors.
+ if (CMAKE_VERSION VERSION_LESS 3.9)
+ set (gflags_DEPENDENCY "find_dependency (gflags ${gflags_VERSION})")
+ else (CMAKE_VERSION VERSION_LESS 3.9)
+ # Passing additional find_package arguments to find_dependency is possible
+ # starting with CMake 3.9.
+ set (glog_POLICY_VERSION 3.9)
+ set (gflags_DEPENDENCY "find_dependency (gflags ${gflags_VERSION} NO_MODULE)")
+ endif (CMAKE_VERSION VERSION_LESS 3.9)
endif (gflags_FOUND)
configure_package_config_file (glog-config.cmake.in