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