1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-14 10:00:11 +00:00

Add Log4cpp::log4cpp imported target

This commit is contained in:
Carles Fernandez 2019-02-04 08:12:25 +01:00
parent 999604cd75
commit d6a3ab2f6f
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 21 additions and 3 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.
#
@ -21,7 +21,10 @@
# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc.
# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP.
# LOG4CPP_FOUND - True if LOG4CPP found.
#
# Provides the following imported target:
# Log4cpp::log4cpp
#
if(LOG4CPP_INCLUDE_DIR)
# Already in cache, be silent
@ -90,3 +93,18 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES)
if (LOG4CPP_FOUND AND NOT TARGET Log4cpp::log4cpp)
add_library(Log4cpp::log4cpp SHARED IMPORTED)
set_target_properties(Log4cpp::log4cpp PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${LOG4CPP_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LOG4CPP_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${LOG4CPP_LIBRARIES}"
)
endif()
mark_as_advanced(
LOG4CPP_LIBRARIES
LOG4CPP_INCLUDE_DIRS
)

View File

@ -48,7 +48,7 @@ target_link_libraries(input_filter_gr_blocks
PRIVATE
Gflags::gflags
Glog::glog
${LOG4CPP_LIBRARIES}
Log4cpp::log4cpp
)
set_property(TARGET input_filter_gr_blocks