OBJECT_NAME.rst 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. OBJECT_NAME
  2. -----------
  3. .. versionadded:: 4.2
  4. Set the object name (without the object extension) of the source file. An
  5. empty string value disables custom object naming. The value must be a relative
  6. path, and may not include special directory components (e.g., ``..``).
  7. Note that the object name may not be used as-is in
  8. :variable:`CMAKE_INTERMEDIATE_DIR_STRATEGY` and
  9. :prop_tgt:`INSTALL_OBJECT_NAME_STRATEGY` strategies, but instead changed as
  10. the strategy requires to fulfill its goals.
  11. When installing objects, the :prop_sf:`INSTALL_OBJECT_NAME` property takes
  12. precedence.
  13. This property supports
  14. :manual:`generator expressions <cmake-generator-expressions(7)>`, but does not
  15. allow for context-sensitive (i.e., configuration-dependent) expressions.
  16. .. note::
  17. No collision resistance within a target is performed by CMake. When using
  18. this property, collisions must be avoided in the project code. CMake has a
  19. number of source files it generates that also create object files that may
  20. collide with a given custom name. These include:
  21. * Generated PCH source files (``cmake_pch``)
  22. * Generated Unity compilation files (``unity_``)
  23. * Qt autogen sources (``moc_compilations.cpp``)
  24. .. note::
  25. The :generator:`FASTBuild` and :generator:`Xcode` generators do not support
  26. this property and it is ignored.