summaryrefslogtreecommitdiffstats
path: root/contrib/cmake/FindGLOG.cmake
blob: e49a77b4abf93ee31ab77fce1e8c0264e3647645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FIND_PATH(GLOG_INCLUDE_DIR glog/logging.h
  PATH_SUFFIXES include src
  PATHS
  /usr/local
  /usr
  /sw # Fink
  /opt/local # DarwinPorts
  /opt/csw # Blastwave
  /opt
  HINTS $ENV{GLOG_SRC}
)

FIND_LIBRARY(GLOG_LIBRARY_RELEASE
  NAMES glog libglog_static
  HINTS $ENV{GLOG_SRC}/.libs/
)
if (GLOG_LIBRARY_RELEASE)
	list(APPEND GLOG_LIBRARY optimized ${GLOG_LIBRARY_RELEASE})
endif()

FIND_LIBRARY(GLOG_LIBRARY_DEBUG
  NAMES glog libglog_static_d
  HINTS $ENV{GLOG_SRC}/.libs/
)
if (GLOG_LIBRARY_DEBUG)
	list(APPEND GLOG_LIBRARY debug ${GLOG_LIBRARY_DEBUG})
else()
	if (UNIX)
		list(APPEND GLOG_LIBRARY debug ${GLOG_LIBRARY_RELEASE})
	endif()
endif()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLOG DEFAULT_MSG GLOG_LIBRARY GLOG_INCLUDE_DIR)
MARK_AS_ADVANCED(GLOG_LIBRARY GLOG_INCLUDE_DIR)