CMAKE_USER_MAKE_RULES_OVERRIDE.rst 1.3 KB

12345678910111213141516171819202122232425
  1. CMAKE_USER_MAKE_RULES_OVERRIDE
  2. ------------------------------
  3. Specify a CMake file that overrides platform information.
  4. CMake loads the specified file while enabling support for each
  5. language from either the :command:`project` or :command:`enable_language`
  6. commands. It is loaded after CMake's builtin compiler and platform information
  7. modules have been loaded but before the information is used. The file
  8. may set platform information variables to override CMake's defaults.
  9. This feature is intended for use only in overriding information
  10. variables that must be set before CMake builds its first test project
  11. to check that the compiler for a language works. It should not be
  12. used to load a file in cases that a normal :command:`include` will work. Use
  13. it only as a last resort for behavior that cannot be achieved any
  14. other way. For example, one may set the
  15. :variable:`CMAKE_C_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>` variable
  16. to change the default value used to initialize the
  17. :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` variable
  18. before it is cached. The override file should NOT be used to set anything
  19. that could be set after languages are enabled, such as variables like
  20. :variable:`CMAKE_RUNTIME_OUTPUT_DIRECTORY` that affect the placement of
  21. binaries. Information set in the file will be used for :command:`try_compile`
  22. and :command:`try_run` builds too.