Can CMake detect if I need to link to libm when using pow in C?
问题 With some compilers, using pow and certain other functions in a C program requires linking to the m library. However, some compilers don't require this and would error out on linking to the m library. An almost identical situation exists for C++ with std::thread and pthread , but the CMake module FindThreads alleviates this entirely - is there some similar module for libm? What is the best way to detect what to do with CMake? This is my current solution, which is less than ideal because there