CMP0002.rst 1.1 KB

123456789101112131415161718192021222324252627
  1. CMP0002
  2. -------
  3. .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
  4. .. include:: include/REMOVED_PROLOGUE.rst
  5. Logical target names must be globally unique.
  6. Targets names created with :command:`add_executable`, :command:`add_library`, or
  7. :command:`add_custom_target` are logical build target names. Logical target
  8. names must be globally unique because:
  9. * Unique names may be referenced unambiguously both in CMake
  10. code and on make tool command lines.
  11. * Logical names are used by Xcode and VS IDE generators
  12. to produce meaningful project names for the targets.
  13. The logical name of executable and library targets does not have to
  14. correspond to the physical file names built. Consider using the
  15. :prop_tgt:`OUTPUT_NAME` target property to create two targets with the same
  16. physical name while keeping logical names distinct. Custom targets
  17. must simply have globally unique names (unless one uses the global
  18. property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
  19. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
  20. .. |WARNED_OR_DID_NOT_WARN| replace:: warned
  21. .. include:: include/REMOVED_EPILOGUE.rst