2018-04-29 10:02:40 +00:00
|
|
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
2018-04-29 10:02:40 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
2018-04-29 10:02:40 +00:00
|
|
|
# GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-05-13 20:49:11 +00:00
|
|
|
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
2014-11-11 22:50:38 +00:00
|
|
|
|
|
|
|
# - Try to find GFlags
|
|
|
|
#
|
2018-04-29 10:02:40 +00:00
|
|
|
# The following variables are optionally searched for defaults
|
|
|
|
# GFlags_ROOT_DIR: Base directory where all GFlags components are found
|
2014-11-11 22:50:38 +00:00
|
|
|
#
|
|
|
|
# The following are set after configuration is done:
|
|
|
|
# GFlags_FOUND
|
|
|
|
# GFlags_INCLUDE_DIRS
|
|
|
|
# GFlags_LIBS
|
|
|
|
# GFlags_LIBRARY_DIRS
|
2018-04-29 10:02:40 +00:00
|
|
|
|
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})
|
2018-02-18 21:48:47 +00:00
|
|
|
if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
|
|
|
|
set(GFLAGS_GREATER_20 TRUE)
|
|
|
|
else(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
|
|
|
|
set(GFLAGS_GREATER_20 FALSE)
|
|
|
|
endif(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
|
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
|
|
|
|