You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some versions of yaml-cpp require to link cmake targets with yaml-cpp,
while more recent version require to link them with yaml-cpp::yaml-cpp.
Is there a way to handle backward compatibility in CMake so it would work in both cases ? Many Linux distros still ship with versions that require yaml-cpp.
Many thanks
The text was updated successfully, but these errors were encountered:
Well, I haven't tried it with yaml-cpp, but I have had to deal with this problem before. Here's a snippet from that:
find_package(date CONFIGNAMES date howardhinnant-date REQUIRED)
message(STATUS "Found and using libdate.")
if(TARGET howardhinnant-date::howardhinnant-date-tz)
add_library(date::date-tz ALIAS howardhinnant-date::howardhinnant-date-tz)
endif()
The advantage of creating the ALIAS library is if you ever need to use it more than one place in your build system, you only have to have the conditional in one place.
Some versions of yaml-cpp require to link cmake targets with
yaml-cpp
,while more recent version require to link them with
yaml-cpp::yaml-cpp
.Is there a way to handle backward compatibility in CMake so it would work in both cases ? Many Linux distros still ship with versions that require
yaml-cpp
.Many thanks
The text was updated successfully, but these errors were encountered: