[cmake-developers] [CMake 0012057]: add_custom_command can not depend on a custom target
Mantis Bug Tracker
mantis at public.kitware.com
Thu Apr 7 18:36:40 EDT 2011
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=12057
======================================================================
Reported By: Stephen Kelly
Assigned To:
======================================================================
Project: CMake
Issue ID: 12057
Category: CMake
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2011-04-07 18:36 EDT
Last Modified: 2011-04-07 18:36 EDT
======================================================================
Summary: add_custom_command can not depend on a custom target
Description:
>From the docs:
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