project.rst 1.1 KB

123456789101112131415161718192021222324252627
  1. project
  2. -------
  3. Set a name for the entire project.
  4. ::
  5. project(<projectname> [languageName1 languageName2 ... ] )
  6. Sets the name of the project. Additionally this sets the variables
  7. <projectName>_BINARY_DIR and <projectName>_SOURCE_DIR to the
  8. respective values.
  9. Optionally you can specify which languages your project supports.
  10. Example languages are CXX (i.e. C++), C, Fortran, etc. By default C
  11. and CXX are enabled. E.g. if you do not have a C++ compiler, you can
  12. disable the check for it by explicitly listing the languages you want
  13. to support, e.g. C. By using the special language "NONE" all checks
  14. for any language can be disabled. If a variable exists called
  15. CMAKE_PROJECT_<projectName>_INCLUDE, the file pointed to by that
  16. variable will be included as the last step of the project command.
  17. The top-level CMakeLists.txt file for a project must contain a
  18. literal, direct call to the project() command; loading one through the
  19. include() command is not sufficient. If no such call exists CMake
  20. will implicitly add one to the top that enables the default languages
  21. (C and CXX).