[CMake] ADD_CUSTOM_COMMAND, 2.2.3 vs. 2.0.6

Egil Brendsdal egilb at ife.no
Tue Jan 24 11:01:17 EST 2006


ADD_CUSTOM_COMMAND in cmake 2.2.3 behaves differently from version 2.0.6;
Using the latest version, the 'custom target' is not included in the makefile.
(As an illustration, see the output from Linux 'grep . CMakeLists.txt cmd; sh cmd'
at the end of the mail.)

Does anyone know a workaround?

  Egil.

+===+

grep . CMakeLists.txt cmd; sh cmd

CMakeLists.txt:  ADD_CUSTOM_COMMAND( OUTPUT "xx"
CMakeLists.txt:		      COMMAND touch
CMakeLists.txt:		      ARGS xx
CMakeLists.txt:  )
cmd:  for version in 2.0.6 2.2.3; do
cmd:    cmake="/usr/local/opt/cmake/$version/bin/cmake";
cmd:    printf "\n";
cmd:    "$cmake" --copyright | head -1 2>&1;
cmd:    ( ( "$cmake" . > /dev/null 2>&1 ) && gmake xx && rm xx && printf "OK\n" ) || printf "FAILED\n";
cmd:  done

CMake version 2.0.6
Building Custom command xx...
OK

cmake version 2.2-patch 3
gmake: *** No rule to make target `xx'.  Stop.
FAILED



More information about the CMake mailing list