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?
Thanks for your reply. The library is SystemC, which we build from source. TBH I don’t know whether or not a library built on Ubuntu will work on Centos or vice versa.
It…can. Depends on what features of the standard library is in use, but in general builds on “older” distros should work reasonably well on “newer” distros if everything above the standard library and “core” things like X are bundled. Determining what is “core” and not is kind of a fine art though.