cmake 2.6: add_custom_command - add_custom_target
Spicy <
spam@...>
2010-01-01 00:57:17 GMT
Hi cmakers,
I decided to start a new project using cmake. While I got a lot of
things going quickly, some things are taking me to despair. The current
issue has a couple of web hits, but either I misunderstand something
critical or cmake 2.6 (as of current Debian Lenny) is broken:
--8<-------CMakeLists.txt------------
cmake_minimum_required(VERSION 2.6)
project(test)
add_custom_command(
OUTPUT bla.txt
COMMAND touch bla.txt
)
add_custom_target(bla DEPENDS bla.txt)
--8<-------CMakeLists.txt------------
I'd expect this to produce an effective Makefile like this:
.phony: bla
bla: bla.txt
bla.txt:
touch bla.txt
Well, cmake Makefiles are somewhat more complicated, but it essentially
misses the final rule, i.e. typing
#~: make bla
make[3]: *** Keine Regel vorhanden, um das Target »../bla.txt«,
benötigt von »CMakeFiles/bla«, zu erstellen. Schluss.
make[2]: *** [CMakeFiles/bla.dir/all] Fehler 2
(Continue reading)