subdirs.rst 1.0 KB

1234567891011121314151617181920212223242526
  1. subdirs
  2. -------
  3. .. deprecated:: 3.0
  4. Use the :command:`add_subdirectory` command instead.
  5. Add a list of subdirectories to the build.
  6. .. code-block:: cmake
  7. subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
  8. [PREORDER])
  9. Add a list of subdirectories to the build. The :command:`add_subdirectory`
  10. command should be used instead of ``subdirs`` although ``subdirs`` will still
  11. work. This will cause any CMakeLists.txt files in the sub directories
  12. to be processed by CMake. Any directories after the ``PREORDER`` flag are
  13. traversed first by makefile builds, the ``PREORDER`` flag has no effect on
  14. IDE projects. Any directories after the ``EXCLUDE_FROM_ALL`` marker will
  15. not be included in the top level makefile or project file. This is
  16. useful for having CMake create makefiles or projects for a set of
  17. examples in a project. You would want CMake to generate makefiles or
  18. project files for all the examples at the same time, but you would not
  19. want them to show up in the top level project or be built each time
  20. make is run from the top.