On Mon, 2014-12-29 at 02:03 +0000, Fraser Hutchison wrote:
> 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()
Sorry for the delayed reply, I was on holiday.
Yes, this will work although it means I get the "Staging ..." message
for every staged file every time I build (even if it doesn't actually
copy unless different); I think that's why I used the other method.
I bit the bullet and changed my rules to build directly into the staging
area rather than copying them afterward. Since I already went through
the pain I'd just as soon not go back again now :-), so I'm all set I
think.
Thanks all!
--
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