MantisBT - CMake
View Issue Details
0013849CMakeCMakepublic2013-01-15 09:492013-06-03 09:05
Ivan Bednyakov 
Brad King 
normalminoralways
closedfixed 
Intel Core I5 CPUMS Windows 7 x64 Pro
CMake 2.8.10.2 
CMake 2.8.11CMake 2.8.11 
0013849: ExternalProject_Add works in a wrong way for DEPENDS property
It should be noticed that at the version 2.8.8 this error didn't appear.
Trying to add dependencies to an ExternalProject brings me to the error like

-External project "MyDependencyLibrary" has no stamp_dir

Actually I have the following CMakeLists tree:
1). A main one, where I declaring targets like IMPORTED libraries (to the libs produced by "MyExternalProject"), etc. and where I have 2 calls to ADD_SUBDIRECTORY(...);
2). A Leaf 1, where ADD_LIBRARY( MyDependencyLibrary ...) exists, defining some target "MyDependencyLibrary";
3). A Leaf 2, where ExternalProject_Add( MyExternalProject DEPENDS MyDependencyLibrary ...) exists;

In such a building tree I get the mentioned above error. At the earlier version (CMake-2.8.8) all was Ok!
No tags attached.
Issue History
2013-01-15 09:49Ivan BednyakovNew Issue
2013-01-15 10:14Brad KingNote Added: 0032104
2013-01-15 10:16Brad KingNote Added: 0032105
2013-01-16 04:08Ivan BednyakovNote Added: 0032108
2013-01-16 10:01Brad KingNote Added: 0032109
2013-01-16 10:01Brad KingAssigned To => Brad King
2013-01-16 10:01Brad KingSeveritymajor => minor
2013-01-16 10:01Brad KingStatusnew => resolved
2013-01-16 10:01Brad KingResolutionopen => fixed
2013-01-16 10:01Brad KingFixed in Version => CMake 2.8.11
2013-01-16 10:01Brad KingTarget Version => CMake 2.8.11
2013-01-16 10:36Brad KingNote Edited: 0032109bug_revision_view_page.php?bugnote_id=32109#r996
2013-06-03 09:05Robert MaynardNote Added: 0033187
2013-06-03 09:05Robert MaynardStatusresolved => closed

Notes
(0032104)
Brad King   
2013-01-15 10:14   
The change was introduced in CMake 2.8.9 by this commit:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d14c0243 [^]

In this hunk:

   # Depend on other external projects (file-level).
   set(file_deps)
   get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
   foreach(dep IN LISTS deps)
-    get_property(dep_stamp_dir TARGET ${dep} PROPERTY _EP_STAMP_DIR)
-    list(APPEND file_deps ${dep_stamp_dir}${cfgdir}/${dep}-done)
+    _ep_get_step_stampfile(${dep} "done" done_stamp_file)
+    list(APPEND file_deps ${done_stamp_file})
   endforeach()


the use of _ep_get_step_stampfile enforces the presence of the _EP_STAMP_DIR on the target with the error message you see.

However, the old code blindly accepted an empty string when the property does not exist, and results in a build-time error about the missing stamp file.
(0032105)
Brad King   
2013-01-15 10:16   
In order to make an ExternalProject target depend on a library target, just use

 ExternalProject_Add(MyExternalProject ...)
 add_dependencies(MyExternalProject MyDependencyLibrary)

This will add the build-order dependency.
(0032108)
Ivan Bednyakov   
2013-01-16 04:08   
Thank you for the reply. I saw this difference in the ExternalProject module (but probably didn't analize it at all :))).
The main reason of creating the bug report is that my project with some dependencies (included via ExternalProject_Add) has been built fine at CMake-2.8.8 but at some other machine with the newer CMake (2.8.10) it cannot be built.
The mentioned solution actually solved the problem.
Thank you!
(0032109)
Brad King   
2013-01-16 10:01   
(edited on: 2013-01-16 10:36)
Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0f1af92 [^]

(0033187)
Robert Maynard   
2013-06-03 09:05   
Closing resolved issues that have not been updated in more than 4 months.