1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00
gnss-sdr/cmake/Modules/FindGOOGLETEST.cmake
Carles Fernandez 4d0d263280
Make the software package compliant with the REUSE Specification v3.0 (see https://reuse.software/spec/)
Update license headers to SPDX format (see https://spdx.org/)
Add license to all files
Add CI job in GitHub Actions to ensure compliance
2020-02-08 01:20:02 +01:00

67 lines
1.7 KiB
CMake

# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# SPDX-License-Identifier: GPL-3.0-or-later
# - Try to find Googletest source code
#
# The following environment variable is optionally searched for:
# GTEST_DIR: Base directory where Googletest source code is found.
#
# The following are set after configuration is done:
# GOOGLETEST_FOUND
# LIBGTEST_DEV_DIR
# GTEST_INCLUDE_DIRS
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include(FindPkgConfig)
pkg_check_modules(PC_GTEST gtest)
find_path(LIBGTEST_DEV_DIR
NAMES src/gtest-all.cc
PATHS
${GTEST_DIR}
${GTEST_DIR}/googletest
/usr/src/googletest/googletest
/usr/src/gtest
/usr/include/gtest
/usr/local/src/googletest/googletest
/opt/local/src/gtest-1.7.0
)
find_path(GTEST_INCLUDE_DIRS
NAMES gtest/gtest.h
HINTS ${PC_GTEST_INCLUDEDIR}
PATHS
${GTEST_DIR}/googletest/include
/usr/include
/usr/local/include
/opt/local/src/gtest-1.7.0/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GOOGLETEST DEFAULT_MSG LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS)
if(GOOGLETEST_FOUND AND PC_GTEST_VERSION)
set(GOOGLETEST_VERSION ${PC_GTEST_VERSION})
set_package_properties(GOOGLETEST PROPERTIES
DESCRIPTION "Source code of Google's Testing Framework (found: v${GOOGLETEST_VERSION})"
)
else()
set_package_properties(GOOGLETEST PROPERTIES
DESCRIPTION "Source code of Google's Testing Framework"
)
endif()
set_package_properties(GOOGLETEST PROPERTIES
URL "https://github.com/google/googletest"
)
mark_as_advanced(LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS)