2012-12-24 02:33:50 +00:00
|
|
|
# - Try to find GFlags
|
|
|
|
#
|
|
|
|
# The following variables are optionally searched for defaults
|
|
|
|
# GFlags_ROOT_DIR: Base directory where all GFlags components are found
|
|
|
|
#
|
|
|
|
# The following are set after configuration is done:
|
|
|
|
# GFlags_FOUND
|
|
|
|
# GFlags_INCLUDE_DIRS
|
|
|
|
# GFlags_LIBS
|
|
|
|
# GFlags_LIBRARY_DIRS
|
2014-11-11 22:50:38 +00:00
|
|
|
|
|
|
|
# - Try to find GFlags
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# The following are set after configuration is done:
|
|
|
|
# GFlags_FOUND
|
|
|
|
# GFlags_INCLUDE_DIRS
|
|
|
|
# GFlags_LIBS
|
|
|
|
# GFlags_LIBRARY_DIRS
|
2012-12-24 02:33:50 +00:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
2014-11-12 19:22:02 +00:00
|
|
|
if(APPLE)
|
2013-01-01 11:24:42 +00:00
|
|
|
FIND_PATH(GFlags_ROOT_DIR
|
|
|
|
libgflags.dylib
|
2014-11-12 19:22:02 +00:00
|
|
|
PATHS
|
2014-05-11 12:50:57 +00:00
|
|
|
/opt/local/lib
|
2013-01-01 11:24:42 +00:00
|
|
|
/usr/local/lib
|
2014-11-12 19:22:02 +00:00
|
|
|
)
|
|
|
|
else(APPLE)
|
2013-01-01 11:24:42 +00:00
|
|
|
FIND_PATH(GFlags_ROOT_DIR
|
|
|
|
libgflags.so
|
|
|
|
HINTS
|
|
|
|
/usr/local/lib
|
2014-11-09 19:31:26 +00:00
|
|
|
/usr/lib/x86_64-linux-gnu
|
|
|
|
/usr/lib/i386-linux-gnu
|
|
|
|
/usr/lib/arm-linux-gnueabihf
|
|
|
|
/usr/lib/arm-linux-gnueabi
|
|
|
|
/usr/lib/aarch64-linux-gnu
|
2016-06-26 19:06:54 +00:00
|
|
|
/usr/lib/mipsel-linux-gnu
|
|
|
|
/usr/lib/mips-linux-gnu
|
|
|
|
/usr/lib/mips64el-linux-gnuabi64
|
|
|
|
/usr/lib/powerpc-linux-gnu
|
|
|
|
/usr/lib/powerpc64-linux-gnu
|
|
|
|
/usr/lib/powerpc64le-linux-gnu
|
2016-11-05 12:40:44 +00:00
|
|
|
/usr/lib/powerpc-linux-gnuspe
|
2016-10-23 09:12:13 +00:00
|
|
|
/usr/lib/hppa-linux-gnu
|
2016-06-26 19:06:54 +00:00
|
|
|
/usr/lib/s390x-linux-gnu
|
2016-11-05 12:40:44 +00:00
|
|
|
/usr/lib/i386-gnu
|
|
|
|
/usr/lib/hppa-linux-gnu
|
|
|
|
/usr/lib/x86_64-kfreebsd-gnu
|
|
|
|
/usr/lib/i386-kfreebsd-gnu
|
|
|
|
/usr/lib/m68k-linux-gnu
|
|
|
|
/usr/lib/sh4-linux-gnu
|
|
|
|
/usr/lib/sparc64-linux-gnu
|
|
|
|
/usr/lib/x86_64-linux-gnux32
|
|
|
|
/usr/lib/alpha-linux-gnu
|
2014-11-09 20:52:02 +00:00
|
|
|
/usr/lib64
|
|
|
|
/usr/lib
|
2013-01-01 11:24:42 +00:00
|
|
|
)
|
2014-11-12 19:22:02 +00:00
|
|
|
endif(APPLE)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
|
|
|
IF(GFlags_ROOT_DIR)
|
2013-01-01 11:24:42 +00:00
|
|
|
# We are testing only a couple of files in the include directories
|
|
|
|
FIND_PATH(GFlags_INCLUDE_DIRS
|
|
|
|
gflags/gflags.h
|
|
|
|
HINTS
|
2014-05-11 12:50:57 +00:00
|
|
|
/opt/local/include
|
2013-01-01 11:24:42 +00:00
|
|
|
/usr/local/include
|
2014-11-09 20:52:02 +00:00
|
|
|
/usr/include
|
2013-01-01 11:24:42 +00:00
|
|
|
${GFlags_ROOT_DIR}/src
|
|
|
|
)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2013-01-01 11:24:42 +00:00
|
|
|
# Find the libraries
|
|
|
|
SET(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR})
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2014-11-12 19:22:02 +00:00
|
|
|
FIND_LIBRARY(GFlags_lib gflags ${GFlags_LIBRARY_DIRS})
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2013-01-01 11:24:42 +00:00
|
|
|
# set up include and link directory
|
|
|
|
include_directories(${GFlags_INCLUDE_DIRS})
|
|
|
|
link_directories(${GFlags_LIBRARY_DIRS})
|
2013-11-13 21:07:33 +00:00
|
|
|
message(STATUS "gflags library found at ${GFlags_lib}")
|
2013-01-01 11:24:42 +00:00
|
|
|
SET(GFlags_LIBS ${GFlags_lib})
|
|
|
|
SET(GFlags_FOUND true)
|
|
|
|
MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS)
|
2012-12-24 02:33:50 +00:00
|
|
|
ELSE(GFlags_ROOT_DIR)
|
2014-11-11 22:50:38 +00:00
|
|
|
MESSAGE(STATUS "Cannot find gflags")
|
2013-01-01 11:24:42 +00:00
|
|
|
SET(GFlags_FOUND false)
|
2012-12-24 02:33:50 +00:00
|
|
|
ENDIF(GFlags_ROOT_DIR)
|
2014-11-11 22:50:38 +00:00
|
|
|
|