My CMake project targets Ubuntu and Centos distros and I need to link to separate libraries for each. How can I detect the distro type and conditionally call target_link_libraries accordingly?
There are some suggestions here: https://stackoverflow.com/questions/26919334/detect-underlying-platform-flavour-in-cmake but the discussion is quite old.
I guess I could define a variable for it that must be set in the CMake invocation but that is not very elegant.