CMP0002.rst 1.0 KB

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