CXX_SCAN_FOR_MODULES.rst 1.1 KB

123456789101112131415161718192021222324252627
  1. CXX_SCAN_FOR_MODULES
  2. --------------------
  3. .. versionadded:: 3.26
  4. ``CXX_SCAN_FOR_MODULES`` is a boolean specifying whether CMake will scan C++
  5. sources in the target for module dependencies. See also the
  6. :prop_sf:`CXX_SCAN_FOR_MODULES` for per-source settings which, if set,
  7. overrides the target-wide settings.
  8. This property is initialized by the value of the
  9. :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable if it is set when a target is
  10. created.
  11. When this property is set ``ON`` or unset, CMake will scan the target's
  12. ``CXX`` sources at build time and add module dependency information to the
  13. compile line as necessary. When this property is set ``OFF``, CMake will not
  14. scan the target's ``CXX`` sources at build time.
  15. Note that scanning is only performed if C++20 or higher is enabled for the
  16. target. Scanning for modules in the target's sources belonging to file sets
  17. of type ``CXX_MODULES`` is always performed.
  18. .. note ::
  19. This setting is meaningful only when experimental support for C++ modules
  20. has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate.