subdirs.rst 1.0 KB

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