No subject


Sun Apr 3 09:54:08 EDT 2011


http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_command

 DEPENDS specifies any target (created by an ADD_* command) a target-level
dependency is created to make sure the target is built before any target using
this custom command.



Steps to Reproduce: 
project(hello)

cmake_minimum_required(VERSION 2.8)
    
add_executable(hello hello.cpp)

add_custom_target(customTarget ALL COMMENT "CUSTOM TARGET")

add_custom_command(OUTPUT customCommandOutput COMMAND sleep 30 DEPENDS
customTarget COMMENT "CUSTOM COMMAND")

add_custom_target(outtarget DEPENDS customCommandOutput COMMENT "OUT")

add_dependencies(hello outtarget)


Additional Information: 
$ make
makeobj[0]: Entering directory
`/home/kde-devel/dev/src/playground/cust_command_broken/build'
Scanning dependencies of target customTarget
[  0%] CUSTOM TARGET                                                            
                                                                                
                                         
[ 25%] Built target customTarget                                                
                                                                                
                                         
Scanning dependencies of target outtarget
make[2]: *** No rule to make target `customTarget', needed by
`customCommandOutput'.  Stop.                                                   
                                                            
make[1]: *** [CMakeFiles/outtarget.dir/all] Error 2
make: *** [all] Error 2
makeobj[0]: Leaving directory
`/home/kde-devel/dev/src/playground/cust_command_broken/build'

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-07 18:36 Stephen Kelly  New Issue                                    
======================================================================



More information about the cmake-developers mailing list