2020-12-30 12:35:06 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2018-12-12 00:37:37 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2021-08-02 07:33:16 +00:00
|
|
|
# SPDX-FileCopyrightText: 2011-2021 C. Fernandez-Prades cfernandez(at)cttc.es
|
2020-12-30 12:35:06 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2018-12-12 00:37:37 +00:00
|
|
|
|
2020-02-29 13:33:09 +00:00
|
|
|
if(GNSSSIMULATOR_ROOT)
|
|
|
|
set(GNSSSIMULATOR_ROOT_USER_DEFINED ${GNSSSIMULATOR_ROOT})
|
|
|
|
else()
|
|
|
|
set(GNSSSIMULATOR_ROOT_USER_DEFINED /usr/local/bin)
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{GNSSSIMULATOR_ROOT})
|
|
|
|
set(GNSSSIMULATOR_ROOT_USER_DEFINED
|
|
|
|
${GNSSSIMULATOR_ROOT_USER_DEFINED}
|
|
|
|
$ENV{GNSSSIMULATOR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
set(GNSSSIMULATOR_ROOT_USER_DEFINED
|
|
|
|
${GNSSSIMULATOR_ROOT_USER_DEFINED}
|
|
|
|
${CMAKE_INSTALL_PREFIX}
|
|
|
|
)
|
|
|
|
|
2018-12-12 00:37:37 +00:00
|
|
|
find_program(SW_GENERATOR_BIN gnss_sim
|
2020-02-29 13:33:09 +00:00
|
|
|
PATHS
|
|
|
|
${GNSSSIMULATOR_ROOT_USER_DEFINED}
|
|
|
|
/usr
|
|
|
|
/usr/local
|
|
|
|
/opt/local
|
2018-12-12 00:37:37 +00:00
|
|
|
PATH_SUFFIXES bin
|
2021-08-02 07:33:16 +00:00
|
|
|
ONLY_CMAKE_FIND_ROOT_PATH
|
2018-12-12 00:37:37 +00:00
|
|
|
)
|
|
|
|
|
2021-08-02 07:33:16 +00:00
|
|
|
if(SW_GENERATOR_BIN AND CMAKE_CROSSCOMPILING)
|
|
|
|
if(CMAKE_SYSROOT)
|
|
|
|
string(REGEX REPLACE "${CMAKE_SYSROOT}" "" SW_GENERATOR_BIN "${SW_GENERATOR_BIN}")
|
|
|
|
elseif(DEFINED ENV{OECORE_TARGET_SYSROOT})
|
|
|
|
string(REGEX REPLACE "$ENV{OECORE_TARGET_SYSROOT}" "" SW_GENERATOR_BIN "${SW_GENERATOR_BIN}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-12-12 00:37:37 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN)
|
|
|
|
mark_as_advanced(SW_GENERATOR_BIN)
|