[PATCH] ExternalProject: make DEPENDS work with "normal" targets

Rolf Eike Beer eike at sf-mail.de
Mon Mar 28 17:21:14 EDT 2011


ExternalProject_Add currently expects it's dependencies to have the property
_EP_STAMP_DIR set which is only true for other targets created by it. Now
it is first checked if that property is actually present and is only taken
as generated by ExternalProject if it does.
---
 Modules/ExternalProject.cmake |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 390b8f9..1aecbfa 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1266,8 +1266,14 @@ function(_ep_add_configure_command name)
   set(file_deps)
   get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
   foreach(dep IN LISTS deps)
+    # Find out if this dependency is itself an external target or not.
+    # If it doesn't have _EP_STAMP_DIR we assume it's a normal target.
     get_property(dep_stamp_dir TARGET ${dep} PROPERTY _EP_STAMP_DIR)
-    list(APPEND file_deps ${dep_stamp_dir}${cfgdir}/${dep}-done)
+    if(dep_stamp_dir)
+      list(APPEND file_deps ${dep_stamp_dir}${cfgdir}/${dep}-done)
+    else(dep_stamp_dir)
+      list(APPEND file_deps ${dep})
+    endif(dep_stamp_dir)
   endforeach()
 
   get_property(cmd_set TARGET ${name} PROPERTY _EP_CONFIGURE_COMMAND SET)
-- 
1.7.3.2


--nextPart5949824.IXETLU54yx--

--nextPart13152522.z0Jnxz0lQK
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)

iEYEABECAAYFAk2Q/N4ACgkQXKSJPmm5/E6VkACdGoddfmtW31oE9E0Q1LBXkTfw
mgoAn3AQU69DbI+ZmMGivXQhhcPrwCh4
=h473
-----END PGP SIGNATURE-----

--nextPart13152522.z0Jnxz0lQK--



More information about the CMake mailing list