1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-03 08:43:04 +00:00

Add more imported targets to CMake scripts

This commit is contained in:
Carles Fernandez
2019-02-04 16:07:29 +01:00
parent 4f440f63dc
commit 9b94a4dec0
21 changed files with 207 additions and 116 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -15,10 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Provides the following imported target:
# Iio::iio
#
########################################################################
# Find the library for the USRP Hardware Driver
########################################################################
include(FindPkgConfig)
pkg_check_modules(PC_UHD uhd)
@@ -72,4 +76,15 @@ find_library(UHD_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
if(UHD_FOUND AND NOT TARGET Uhd::uhd)
add_library(Uhd::uhd SHARED IMPORTED)
set_target_properties(Uhd::uhd PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${UHD_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${UHD_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${UHD_LIBRARIES}"
)
endif()
mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)