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
[email protected] <mailto:[email protected]> | 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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to