By example of spdlog
package:
find_package(spdlog 1.13.0 EXACT REQUIRED)
message("spdlog_FOUND: ${spdlog_FOUND}")
get_property(SPDLOG_INTERFACE_INCLUDE_DIRECTORIES TARGET spdlog::spdlog_header_only PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Location of spdlog: ${SPDLOG_INTERFACE_INCLUDE_DIRECTORIES}")
How to print all the properties of a target in cmake?
https://stackoverflow.com/a/34292622/2394762
CMake Warning (dev) at CMake/AwlLink.cmake:97 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run “cmake –help-policy CMP0074” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Environment variable spdlog_ROOT is set to:
/home/dmitriano/dev/libs/spdlog
For compatibility, CMake is ignoring the variable.