After I edited the CMakeLists file locally by changing the target name to cpptrace::cpptrace inside the add_custom_command function I was able to install the library successfully. I think changing the fixed cpptrace value inside this function to some kind of local variable which would contain the valid target name based on ASSERT_USE_EXTERNAL_CPPTRACE flag value should do the trick.
When I tried installing libassert (release v1.2.1) using CMake with ASSERT_USE_EXTERNAL_CPPTRACE flag an error occurs after building the library which is raised here: https://github.com/jeremy-rifkin/libassert/blob/56ddd631ccc133d4d25f7b8051371d931783a40b/CMakeLists.txt#L165-L170
The reason this error occurs is that the
cpptrace
target is not found due to the fact that the actual target name iscpptrace::cpptrace
after it is added byfind_package
: https://github.com/jeremy-rifkin/libassert/blob/56ddd631ccc133d4d25f7b8051371d931783a40b/CMakeLists.txt#L72-L74After I edited the CMakeLists file locally by changing the target name to
cpptrace::cpptrace
inside theadd_custom_command
function I was able to install the library successfully. I think changing the fixedcpptrace
value inside this function to some kind of local variable which would contain the valid target name based on ASSERT_USE_EXTERNAL_CPPTRACE flag value should do the trick.