On 2010-01-01 01:57+0100 Spicy wrote:
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------------
Any ideas what is going wrong here?
Yes. replace bla.txt everywhere by ${CMAKE_CURRENT_BINARY_DIR}/bla.txt, and
all will be well. I have just checked that works, and also verified the
problem you found if you use bla.txt instead.
It's possible you might be able to also solve the problem using
WORKING_DIRECTORY, but I am not sure about that, and I know
${CMAKE_CURRENT_BINARY_DIR}/bla.txt (i.e., being specific about the
path) always does work.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
_______________________________________________
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