CMP0002.rst 1.2 KB

12345678910111213141516171819202122232425262728
  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 :generator:`Xcode` and
  12. :ref:`Visual Studio <Visual Studio Generators>` IDE generators
  13. to produce meaningful project names for the targets.
  14. The logical name of executable and library targets does not have to
  15. correspond to the physical file names built. Consider using the
  16. :prop_tgt:`OUTPUT_NAME` target property to create two targets with the same
  17. physical name while keeping logical names distinct. Custom targets
  18. must simply have globally unique names (unless one uses the global
  19. property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
  20. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
  21. .. |WARNED_OR_DID_NOT_WARN| replace:: warned
  22. .. include:: include/REMOVED_EPILOGUE.rst