1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 00:02:21 +08:00

Help: Remove recommendations for using CMAKE_CFG_INTDIR

Commit e71c4f7729 (CMAKE_CFG_INTDIR: Formally deprecate in favor of
$<CONFIG>, 2021-05-27) only updated the docs for CMAKE_CFG_INTDIR
itself, but other parts of the docs still used it. Update the other places
to avoid referring to the now-deprecated variable.
This commit is contained in:
Craig Scott
2021-06-06 17:14:29 +10:00
parent 42af35136f
commit 41dea08423
2 changed files with 14 additions and 14 deletions

View File

@@ -68,26 +68,24 @@ architecture:
# /path/to/somewhere/objects-iphonesimulator/x86_64/func.o # /path/to/somewhere/objects-iphonesimulator/x86_64/func.o
In some cases, you may want to have configuration-specific object files In some cases, you may want to have configuration-specific object files
as well. The :variable:`CMAKE_CFG_INTDIR` variable can be a convenient as well. The ``$(CONFIGURATION)`` Xcode variable is often used for this and
way of capturing this in combination with the SDK: can be used in conjunction with the others mentioned above:
.. code-block:: cmake .. code-block:: cmake
add_library(someObjs OBJECT IMPORTED) add_library(someObjs OBJECT IMPORTED)
set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS
"/path/to/somewhere/${CMAKE_CFG_INTDIR}/$(CURRENT_ARCH)/func.o" "/path/to/somewhere/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/$(CURRENT_ARCH)/func.o"
) )
# Example paths: # Example paths:
# /path/to/somewhere/Release-iphoneos/arm64/func.o # /path/to/somewhere/Release-iphoneos/arm64/func.o
# /path/to/somewhere/Debug-iphonesimulator/x86_64/func.o # /path/to/somewhere/Debug-iphonesimulator/x86_64/func.o
When any Xcode variable or :variable:`CMAKE_CFG_INTDIR` is used, CMake is When any Xcode variable is used, CMake is not able to fully evaluate the
not able to fully evaluate the path(s) at configure time. One consequence path(s) at configure time. One consequence of this is that the
of this is that the configuration-specific configuration-specific :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` properties cannot
:prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` properties cannot be used, since be used, since CMake cannot determine whether an object file exists at a
CMake cannot determine whether an object file exists at a particular particular ``<CONFIG>`` location. The ``IMPORTED_OBJECTS`` property must be
``<CONFIG>`` location. The ``IMPORTED_OBJECTS`` property must be used for used for these situations and the configuration-specific aspects of the path
these situations and the configuration-specific aspects of the path must be should be handled by the ``$(CONFIGURATION)`` Xcode variable.
handled by using :variable:`CMAKE_CFG_INTDIR` or with another Xcode variable
``$(CONFIGURATION)``.

View File

@@ -6,5 +6,7 @@ Specifies the available build types on multi-config generators.
This specifies what build types (configurations) will be available This specifies what build types (configurations) will be available
such as ``Debug``, ``Release``, ``RelWithDebInfo`` etc. This has reasonable such as ``Debug``, ``Release``, ``RelWithDebInfo`` etc. This has reasonable
defaults on most platforms, but can be extended to provide other build defaults on most platforms, but can be extended to provide other build
types. See also :variable:`CMAKE_BUILD_TYPE` for details of managing types.
configuration data, and :variable:`CMAKE_CFG_INTDIR`.
See :variable:`CMAKE_BUILD_TYPE` for specifying the configuration with
single-config generators.