diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-06-28 16:37:39 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-10-11 21:17:27 +0200 |
commit | e4e5b28c27dc2e6f0073e11fb64c4ea62022a051 (patch) | |
tree | ba7aa13e6521fcf786811b9679b23269a11e5d36 /Utilities/CMakeLists.txt | |
parent | 7e4910fe47d667e059e42ac6395b0f4726f17064 (diff) | |
download | cmake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.tar.gz |
cmTarget: Deprecate the LOCATION target property with a policy.
The final location and name of a build-target is not determined
until generate-time. However, reading the LOCATION property from
a target is currently allowed at configure time. Apart from creating
possibly-erroneous results, this has an impact on the implementation
of cmake itself, and prevents some major cleanups from being made.
Disallow reading LOCATION from build-targets with a policy. Port some
existing uses of it in CMake itself to use the TARGET_FILE generator
expression.
Diffstat (limited to 'Utilities/CMakeLists.txt')
-rw-r--r-- | Utilities/CMakeLists.txt | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index bad8d630e6..31807eee14 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -48,14 +48,12 @@ set(DOCBOOK_FILES ) macro(ADD_DOCS target dependency) - # Generate documentation for "ctest" executable. - get_target_property(CMD ${target} LOCATION) # only generate the documentation if the target is actually built - if(CMD) + if(${target}) add_custom_command( OUTPUT ${CMake_BINARY_DIR}/Docs/${target}.txt ${${target}-PATH} # Possibly set PATH, see below. - COMMAND ${CMD} + COMMAND $<TARGET_FILE:${target}> ARGS --help-full ${CMake_BINARY_DIR}/Docs/${target}.txt --help-full ${CMake_BINARY_DIR}/Docs/${target}.html --help-full ${CMake_BINARY_DIR}/Docs/${target}.1 @@ -92,10 +90,9 @@ ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in) # add the documentation for cmake itself -get_target_property(CMD cmake LOCATION) add_custom_command( OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt - COMMAND ${CMD} + COMMAND $<TARGET_FILE:cmake> ARGS --copyright ${CMake_BINARY_DIR}/Docs/Copyright.txt --help-full ${CMake_BINARY_DIR}/Docs/cmake.txt --help-full ${CMake_BINARY_DIR}/Docs/cmake.html |