[CMake] modify cmake build arguments
hex
hex7c3 at gmail.com
Fri Aug 30 06:16:24 EDT 2019
thank you this is exactly what I am looking for. It is working well.
From the documentation:
«It is loaded after CMake’s builtin compiler and platform information
modules have been loaded but before the information is used.»
since CMakeCInformation.cmake:
# compile a C file into an object file
if(NOT CMAKE_C_COMPILE_OBJECT)
set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c
<SOURCE>")
endif()
CMAKE_USER_MAKE_RULES_OVERRIDE_C must be set before the language is set,
i.e. before any `enable_language()` or `project()` instruction.
On 30/08/2019 06:47, Eric Doenges wrote:
>
> The way I understand the documentation, CMAKE_USER_MAKE_RULES_OVERRIDE
> applies for all generators, not just the Makefile one. What you are
> apparently supposed to do is create a file that sets all the "rule
> variables" as required (in this case, CMAKE_C_COMPILE_OBJECT), and
> then include that file via CMAKE_USER_MAKE_RULES_OVERRIDE. I'm not
> sure if these 'rule variables' are documented anywhere - but you can
> look into "<path where CMake is
> installed>/share/cmake-<version>/Modules/Compiler" for inspiration.
> Another good starting point would be
> "<...>/share/cmake-<version>/Modules/CMakeCInformation.cmake".
>
> With kind regards,
> Eric
>
> *Dr. Eric Dönges *
> Senior Software Engineer
>
> MVTec Software GmbH | Arnulfstr. 205 | 80634 Munich | Germany
> doenges at mvtec.com <mailto:doenges at mvtec.com> | Tel: +49 89 457 695-0 |
> www.mvtec.com <http://www.mvtec.com>
>
> Sign up <http://www.mvtec.com/newsletter> for our MVTec Newsletter!
>
> Geschäftsführer: Dr. Wolfgang Eckstein, Dr. Olaf Munkelt
> Amtsgericht München HRB 114695
>
> MVTec Software GmbH Logo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190830/e407976e/attachment-0001.html>
More information about the CMake
mailing list