From 6ca10ab652efdc105f5d8b77df4c3b190c11eca1 Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Mon, 5 Dec 2016 16:47:18 -0500 Subject: [PATCH] Only use TERMINAL feature with supported CMake version Change-Id: Icd1b8c0e7e8f45ef91b97f621fcf17f886d591bf --- SuperBuild/External_GTest.cmake | 5 +---- SuperBuild/External_ITK.cmake | 7 ++----- SuperBuild/External_Lua.cmake | 5 +---- SuperBuild/External_PCRE.cmake | 5 +---- SuperBuild/External_SimpleITKExamples.cmake | 3 +-- SuperBuild/External_Swig.cmake | 7 ++----- SuperBuild/External_virtualenv.cmake | 2 +- SuperBuild/SuperBuild.cmake | 12 +++++++++--- 8 files changed, 18 insertions(+), 28 deletions(-) diff --git a/SuperBuild/External_GTest.cmake b/SuperBuild/External_GTest.cmake index f203fefd2..9985c9499 100644 --- a/SuperBuild/External_GTest.cmake +++ b/SuperBuild/External_GTest.cmake @@ -42,7 +42,6 @@ endif() ExternalProject_Add(${proj} URL "${GTEST_URL}" URL_MD5 ${GTEST_DOWNLOAD_SOURCE_HASH} - USES_TERMINAL_DOWNLOAD 1 INSTALL_DIR ${GTEST_install_dir} CMAKE_GENERATOR ${gen} CMAKE_ARGS @@ -53,13 +52,11 @@ ExternalProject_Add(${proj} -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=/lib -D gtest_disable_pthreads:BOOL=ON - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_ARCHIVE_OUTPUT_DIRECTORY} /lib COMMAND ${CMAKE_COMMAND} -E copy_directory /include /include + ${External_Project_USES_TERMINAL} ) sitkSourceDownloadDependency(${proj}) diff --git a/SuperBuild/External_ITK.cmake b/SuperBuild/External_ITK.cmake index d41b4fe92..f9bf56fdb 100644 --- a/SuperBuild/External_ITK.cmake +++ b/SuperBuild/External_ITK.cmake @@ -57,7 +57,6 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_ ExternalProject_Add(${proj} GIT_REPOSITORY ${ITK_REPOSITORY} ${ITK_TAG_COMMAND} - USES_TERMINAL_DOWNLOAD 1 UPDATE_COMMAND "" SOURCE_DIR ${proj} BINARY_DIR ${proj}-build @@ -95,11 +94,9 @@ ExternalProject_Add(${proj} -DSWIG_DIR:PATH=${SWIG_DIR} -DSWIG_EXECUTABLE:PATH=${SWIG_EXECUTABLE} BUILD_COMMAND ${BUILD_COMMAND_STRING} - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 DEPENDS - ${ITK_DEPENDENCIES} + ${ITK_DEPENDENCIES} + ${External_Project_USES_TERMINAL} ) diff --git a/SuperBuild/External_Lua.cmake b/SuperBuild/External_Lua.cmake index 6ee9543b9..30b3a44f5 100644 --- a/SuperBuild/External_Lua.cmake +++ b/SuperBuild/External_Lua.cmake @@ -28,7 +28,6 @@ set(lua_PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ExternalProject_Add(Lua URL "${lua_URL}" URL_MD5 "${lua_DOWNLOAD_SOURCE_HASH}" - USES_TERMINAL_DOWNLOAD 1 PATCH_COMMAND ${lua_PATCH_COMMAND} CMAKE_GENERATOR ${gen} CMAKE_ARGS @@ -37,9 +36,7 @@ ExternalProject_Add(Lua ${ep_common_args} -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=${lua_install_dir} - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 + ${External_Project_USES_TERMINAL} ) sitkSourceDownloadDependency(Lua) diff --git a/SuperBuild/External_PCRE.cmake b/SuperBuild/External_PCRE.cmake index 21c6aee4d..48516f06b 100644 --- a/SuperBuild/External_PCRE.cmake +++ b/SuperBuild/External_PCRE.cmake @@ -39,12 +39,9 @@ if(NOT PCRE_DIR) ExternalProject_add(PCRE URL "${PCRE_URL}" URL_MD5 "${PCRE_DOWNLOAD_SOURCE_HASH}" - USES_TERMINAL_DOWNLOAD 1 CONFIGURE_COMMAND ${pcre_CONFIGURE_COMMAND} DEPENDS "${PCRE_DEPENDENCIES}" - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 + ${External_Project_USES_TERMINAL} ) sitkSourceDownloadDependency(PCRE) diff --git a/SuperBuild/External_SimpleITKExamples.cmake b/SuperBuild/External_SimpleITKExamples.cmake index 51915a2bf..5c43e9393 100644 --- a/SuperBuild/External_SimpleITKExamples.cmake +++ b/SuperBuild/External_SimpleITKExamples.cmake @@ -23,11 +23,10 @@ if (${BUILD_EXAMPLES} ) -DSimpleITK_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SimpleITK-0.11/ -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH= - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 BUILD_COMMAND ${BUILD_COMMAND_STRING} INSTALL_COMMAND "" DEPENDS "${SimpleITKExamples_DEPENDENCIES}" + ${External_Project_USES_TERMINAL} ) endif() diff --git a/SuperBuild/External_Swig.cmake b/SuperBuild/External_Swig.cmake index 034d76297..6baa9e7d8 100644 --- a/SuperBuild/External_Swig.cmake +++ b/SuperBuild/External_Swig.cmake @@ -44,11 +44,11 @@ if(NOT SWIG_DIR) ExternalProject_Add(Swig URL "${SWIGWIN_URL}" URL_MD5 ${SWIG_DOWNLOAD_WIN_HASH} - USES_TERMINAL_DOWNLOAD 1 SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + ${External_Project_USES_TERMINAL} ) add_dependencies(Swig "SuperBuildSimpleITKSource") @@ -108,12 +108,9 @@ if(NOT SWIG_DIR) ExternalProject_add(Swig ${SWIG_DOWNLOAD_STEP} - USES_TERMINAL_DOWNLOAD 1 CONFIGURE_COMMAND ${swig_CONFIGURE_COMMAND} - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 DEPENDS "${Swig_DEPENDENCIES}" + ${External_Project_USES_TERMINAL} ) if(NOT USE_SWIG_FROM_GIT) diff --git a/SuperBuild/External_virtualenv.cmake b/SuperBuild/External_virtualenv.cmake index 9c3da4697..db7f9a22b 100644 --- a/SuperBuild/External_virtualenv.cmake +++ b/SuperBuild/External_virtualenv.cmake @@ -22,7 +22,6 @@ sitkSourceDownload(${proj}_URL "virtualenv-${${proj}_TARGET_VERSION}.tar.gz" ${$ ExternalProject_Add(${proj} URL "${${proj}_URL}" URL_MD5 ${${proj}_DOWNLOAD_SOURCE_HASH} - USES_TERMINAL_DOWNLOAD 1 SOURCE_DIR ${${proj}_source_dir} BINARY_DIR ${${proj}_binary_dir} INSTALL_DIR ${${proj}_install_dir} @@ -31,6 +30,7 @@ ExternalProject_Add(${proj} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + ${External_Project_USES_TERMINAL} ) sitkSourceDownloadDependency(${proj}) diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index 613c98afc..1dca1857c 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -278,6 +278,14 @@ VariableListToCache( ep_common_list ep_common_cache ) include(sitkLanguageOptions) +if(NOT CMAKE_VERSION VERSION_LESS 3.4) + set(External_Project_USES_TERMINAL + USES_TERMINAL_DOWNLOAD 1 + USES_TERMINAL_CONFIGURE 1 + USES_TERMINAL_BUILD 1 + USES_TERMINAL_INSTALL 1) +endif() + #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ include(ExternalProject) @@ -425,10 +433,8 @@ ExternalProject_Add(${proj} -DWRAP_CSHARP:BOOL=${WRAP_CSHARP} -DWRAP_R:BOOL=${WRAP_R} -DBUILD_EXAMPLES:BOOL=${BUILD_TESTING} - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 DEPENDS ${${CMAKE_PROJECT_NAME}_DEPENDENCIES} + ${External_Project_USES_TERMINAL} ) ExternalProject_Add_Step(${proj} forcebuild