[CMake] Basic question how to find -lm include and lib dir with find_package or otherwise

frodak17 frodak17 at gmail.com
Fri Mar 15 07:46:11 EDT 2019


On Thu, Mar 14, 2019 at 8:53 PM Workbench at gmx.at <workbench at gmx.at> wrote:

> Hi everyone,
>
> i'm searching for a way to find the right include dir so that -lm can be
> found, the is not find_package for this, is /usr/lib and /usr/include a
> default because he find it without me adding any include or lib path for
> the build.
>
>
>
It seems strange that you need to do this.  In my experience 'm' is just
the math portion of the 'c' library.  Depending on which host and toolset
you are using there can be multiple version of the 'm' library depending on
target architecture and other options used.  The linker should just use the
correct 'm' library just as it uses the correct 'c' library.  It could be
in /usr/lib depending on how the compiler was packaged for your host.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190315/f48b7283/attachment.html>


More information about the CMake mailing list