[CMake] Is there a variable containing the C flags that would be used to compile something in a directory
Matthew Keeler
mkeeler at tenable.com
Tue Sep 29 15:03:12 EDT 2015
There are various variables like CMAKE_C_FLAGS_<CONFIG> that can influence the final flags sent to the compiler. Is there a variable that exists or a function to call to get the final C flags.
What I am trying to do is invoke a custom command to run make on an external source tree. This makefile has CC, AR, RANLIB CFLAGS and LDFLAGS variables. The command I would like to do is
add_custom_command(<OUTPUT> COMMAND make CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CFLAGS=<what to put here> LDFLAGS=<what to put here> ……)
However it doesn’t seem like there is a variable that contains a set of all the flags that cmake would use. For example, when building on OS X the -mmacosx-version-min flag gets tacked on by cmake but I can’t find a variable that contains this flag.
Is there a way to do what I want or am I going to have to manage all the C flags manually?
--
Matt Keeler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150929/8a5755ee/attachment.html>
More information about the CMake
mailing list