CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst 970 B

123456789101112131415161718192021222324252627
  1. CMAKE_NINJA_OUTPUT_PATH_PREFIX
  2. ------------------------------
  3. Set output files path prefix for the :generator:`Ninja` generator.
  4. Every output files listed in the generated ``build.ninja`` will be
  5. prefixed by the contents of this variable (a trailing slash is
  6. appended if missing). This is useful when the generated ninja file is
  7. meant to be embedded as a ``subninja`` file into a *super* ninja
  8. project. For example, a ninja build file generated with a command
  9. like::
  10. cd top-build-dir/sub &&
  11. cmake -G Ninja -DCMAKE_NINJA_OUTPUT_PATH_PREFIX=sub/ path/to/source
  12. can be embedded in ``top-build-dir/build.ninja`` with a directive like
  13. this::
  14. subninja sub/build.ninja
  15. The ``auto-regeneration`` rule in ``top-build-dir/build.ninja`` must have an
  16. order-only dependency on ``sub/build.ninja``.
  17. .. note::
  18. When ``CMAKE_NINJA_OUTPUT_PATH_PREFIX`` is set, the project generated
  19. by CMake cannot be used as a standalone project. No default targets
  20. are specified.