If one of the CMake-provided Find Modules (e.g. FindBacktrace) provides an imported target, it will almost certainly be documented. You can inspect the source code of the Find Module to be sure. In your case, for FindBacktrace.cmake
, just search the file for the ::
syntax of the imported target it may provide. At the time of writing, FindBacktrace.cmake
does not provide one.
Because many of the Find Modules pre-date the arrival of modern CMake, there are actually many of them that do not yet provide imported targets. I imagine the CMake maintainers are tackling this task as dictated by the need and popularity of each module, so writing a CMake issue for the FindBacktrace module might provoke some action.
If so inspired, you could also write your own modified FindBacktrace.cmake
file, adding the requisite CMake code to define the imported target Backtrace::Backtrace
.
If the system (e.g. libc
) provides support for backtrace(3)
, it is expected that the Backtrace_LIBRARY
variable will be empty. The FindBacktrace module will pick up the default library if available, and populate it in Backtrace_LIBRARIES
.
The Backtrace_LIBRARY
cache path should only be used if your backtrace is available on your system through some other external library or package, such as on non-glibc systems. In that case, you'll populate Backtrace_LIBRARY
manually.