mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Add Log4cpp::log4cpp imported target
This commit is contained in:
		| @@ -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. | # This file is part of GNSS-SDR. | ||||||
| # | # | ||||||
| @@ -21,7 +21,10 @@ | |||||||
| #  LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. | #  LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. | ||||||
| #  LOG4CPP_LIBRARIES   - List of libraries when using LOG4CPP. | #  LOG4CPP_LIBRARIES   - List of libraries when using LOG4CPP. | ||||||
| #  LOG4CPP_FOUND       - True if LOG4CPP found. | #  LOG4CPP_FOUND       - True if LOG4CPP found. | ||||||
|  | # | ||||||
|  | # Provides the following imported target: | ||||||
|  | # Log4cpp::log4cpp | ||||||
|  | # | ||||||
|  |  | ||||||
| if(LOG4CPP_INCLUDE_DIR) | if(LOG4CPP_INCLUDE_DIR) | ||||||
|   # Already in cache, be silent |   # Already in cache, be silent | ||||||
| @@ -90,3 +93,18 @@ endif() | |||||||
|  |  | ||||||
| include(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) | 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 | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ target_link_libraries(input_filter_gr_blocks | |||||||
|     PRIVATE |     PRIVATE | ||||||
|         Gflags::gflags |         Gflags::gflags | ||||||
|         Glog::glog |         Glog::glog | ||||||
|         ${LOG4CPP_LIBRARIES} |         Log4cpp::log4cpp | ||||||
| ) | ) | ||||||
|  |  | ||||||
| set_property(TARGET input_filter_gr_blocks | set_property(TARGET input_filter_gr_blocks | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez