I have a custom command that depends on a custom target. In the example below,
it is as if
ADD_CUSTOM_COMMAND(... DEPENDS t ...)
has no effect:
# CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(CUSTOMDEPENDS NONE)
ADD_CUSTOM_TARGET(t
${CMAKE_COMMAND} -E echo "Building target t"
VERBATIM)
ADD_CUSTOM_COMMAND(OUTPUT stamp
COMMAND ${CMAKE_COMMAND} -E touch stamp
DEPENDS t
VERBATIM)
ADD_CUSTOM_TARGET(main ALL
${CMAKE_COMMAND} -E echo "Building target main"
DEPENDS stamp
VERBATIM)
# Fedora 11 with CMake 2.8 generating GNU make
> make
Scanning dependencies of target t
Building target t
[ 0%] Built target t
Scanning dependencies of target main
make[2]: *** No rule to make target `t', needed by `stamp'. Stop.
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
Target t is built, and I can 'make t' myself, so the target is in fact there.
My particular situation is that I am,
1. Creating a language binding using SWIG
2. Compiling the resulting C#
If you look just beneath the surface, this is the same situation illustrated in
the above example. SWIG and C# themselves are working fine.
Is there any way to work around this? Shall I enter this as a bug?
This issue was raised earlier as
http://www.cmake.org/pipermail/cmake/2010-November/040541.html but no solution
was given. The excellent example is from that earlier message.
John McGehee
http://www.voom.net
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake