PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE.rst 939 B

12345678910111213141516171819
  1. PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE
  2. -------------------------------------------
  3. .. versionadded:: 3.30
  4. When this global property is set to true, the
  5. :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` variable is propagated into
  6. :command:`try_compile` calls that use the
  7. :ref:`whole-project signature <Try Compiling Whole Projects>`.
  8. Calls to the :ref:`source file signature <Try Compiling Source Files>` are not
  9. affected by this property.
  10. ``PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE`` is unset by default.
  11. For :ref:`dependency providers <dependency_providers_overview>` that want to
  12. be enabled in whole-project :command:`try_compile` calls, set this global
  13. property to true just before or after registering the provider.
  14. Note that all files listed in :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES`
  15. will need to be able to handle being included in such :command:`try_compile`
  16. calls, and it is the user's responsibility to ensure this.