These two patches address some issues I found: -ExternalProject_Add(... DEPENDS something) does not work if that something is not itself created by ExternalProject_Add(). Fixed and testcase added.
-The testcases for ExternalProject fail to detect on my German system my Subversion version. We had the issue back in the FindSubversion.cmake some time again and fixed it there, no need to duplicate the old wrong code here. The patches are independent of each other. Greetings, Eike
>From e9e8a581a9c9384beac2390cc867de40e44fc00f Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer <[email protected]> Date: Tue, 1 Nov 2011 18:38:52 +0100 Subject: [PATCH] fix Subversion detection in ExternalProject tests This test will fail to get a proper version number if running on a (e.g. German) localized system because the regular expression used to match the Subversion version output does not match. Instead of duplicating code just remove the local test altogether and use the version that FindSubversion.cmake already detects. --- Tests/ExternalProject/CMakeLists.txt | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 4a542d7..ac70129 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -343,13 +343,6 @@ endif() # Only do svn tests with svn >= version 1.2 # if(do_svn_tests) - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} --version - OUTPUT_VARIABLE Subversion_VERSION_SVN - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" - "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") - message(STATUS "Subversion_VERSION_SVN='${Subversion_VERSION_SVN}'") - if(Subversion_VERSION_SVN VERSION_LESS 1.2) message(STATUS "No ExternalProject svn tests with svn client less than version 1.2") set(do_svn_tests 0) -- 1.7.3.2
>From 84e6a1774d07baf45c5784f8e2d37cc4f9c4468b Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer <[email protected]> Date: Tue, 01 Nov 2011 18:21:14 +0200 Subject: [PATCH] ExternalProject: make DEPENDS work with "normal" targets ExternalProject_Add currently expects it's dependencies to have the property _EP_STAMP_DIR set which is only true for other targets created by ExternalProject_Add. 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 +++++++- Tests/ExternalProject/CMakeLists.txt | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index a37771b..0af6cf9 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1275,8 +1275,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) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 4a542d7..19f91a1 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -111,6 +111,23 @@ ExternalProject_Add(${proj} ) set_property(TARGET ${proj} PROPERTY FOLDER "") +add_custom_target(EmptyTarget) + +set(proj DependsOnTarget) +ExternalProject_Add(${proj} + BUILD_COMMAND "" + CMAKE_ARGS "" + CONFIGURE_COMMAND "" + DEPENDS "EmptyTarget" + DOWNLOAD_COMMAND "" + INSTALL_COMMAND "" + PATCH_COMMAND "" + STEP_TARGETS install + URL "" + URL_MD5 "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "") + # Local DIR: # -- 1.7.3.2
signature.asc
Description: This is a digitally signed message part.
-- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
