|
Hi Paul, I'd have thought the following replacement would work the same: function(stageobj target dir) add_custom_target(stage_${target} ALL COMMAND "${CMAKE_COMMAND}" -E make_directory
"${DESTDIR}/${dir}" COMMAND "${CMAKE_COMMAND}" -E
copy_if_different "$<TARGET_FILE:${target}>"
"${DESTDIR}/${dir}" COMMENT "Staging ${target} to
${DESTDIR}/${dir}" VERBATIM) add_dependencies(stage_${target} ${target}) endfunction()Alternatively, you can tell CMake to allow the use of the LOCATION target property by setting the relevant policy to use the old behaviour temporarily: function(stageobj target dir) cmake_policy(PUSH) if(POLICY CMP0026) cmake_policy(SET CMP0026 OLD) endif() get_property(targetpath TARGET ${target} PROPERTY
LOCATION) cmake_policy(POP) ... endfunction()Cheers, Fraser. On 24/12/2014 13:04, Paul Smith wrote:
On Tue, 2014-12-23 at 16:59 -0500, David Cole wrote:Are you sure there's a problem using TARGET_FILE in your original context?You should be able to use that in a custom command in your custom stage_tgt target...You have to give the name of the target for the TARGET_FILE generator _expression_, so it should work for any target that cmake knows about. Can you point to a simplified reproducible case where this does not work? Maybe there's some other complication in your real project that is making it seem like it's not working.... but I think it should. Can you send us any code? |
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
