diff --git a/CMakeExternals/CTKData.cmake b/CMakeExternals/CTKData.cmake index ddd45f98cf..9d428606cc 100644 --- a/CMakeExternals/CTKData.cmake +++ b/CMakeExternals/CTKData.cmake @@ -17,6 +17,9 @@ IF(BUILD_TESTING) IF(NOT DEFINED CTKData_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY ${git_protocol}://github.com/commontk/CTKData.git GIT_TAG "origin/master" CONFIGURE_COMMAND "" @@ -25,7 +28,7 @@ IF(BUILD_TESTING) DEPENDS ${proj_DEPENDENCIES} ) - SET(CTKData_DIR ${ep_source_dir}/${proj}) + SET(CTKData_DIR ${CMAKE_BINARY_DIR}/${proj}) ELSE() ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() diff --git a/CMakeExternals/DCMTK.cmake b/CMakeExternals/DCMTK.cmake index f2742efe98..35c2ae71eb 100644 --- a/CMakeExternals/DCMTK.cmake +++ b/CMakeExternals/DCMTK.cmake @@ -22,21 +22,24 @@ IF(${add_project}) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} - GIT_REPOSITORY "${git_protocol}://github.com/commontk/DCMTK.git" - GIT_TAG "origin/patched" - CMAKE_GENERATOR ${gen} - BUILD_COMMAND "" - CMAKE_ARGS - ${ep_common_args} - -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...) - ) + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} + GIT_REPOSITORY "${git_protocol}://github.com/commontk/DCMTK.git" + GIT_TAG "origin/patched" + CMAKE_GENERATOR ${gen} + BUILD_COMMAND "" + CMAKE_ARGS + ${ep_common_args} + -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...) + ) SET(DCMTK_DIR ${ep_install_dir}) ExternalProject_Add_Step(${proj} force_rebuild COMMENT "Force ${proj} re-build" DEPENDERS build # Steps that depend on this step ALWAYS 1 - WORKING_DIRECTORY ${ep_build_dir}/${proj} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${proj}-build DEPENDS ${proj_DEPENDENCIES} ) diff --git a/CMakeExternals/ITK.cmake b/CMakeExternals/ITK.cmake index 3160043ae9..331c29f0f7 100644 --- a/CMakeExternals/ITK.cmake +++ b/CMakeExternals/ITK.cmake @@ -19,6 +19,9 @@ IF(${add_project}) IF(NOT DEFINED ITK_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git" GIT_TAG "origin/master" INSTALL_COMMAND "" @@ -37,7 +40,7 @@ IF(${add_project}) DEPENDS ${proj_DEPENDENCIES} ) - SET(ITK_DIR ${ep_build_dir}/${proj}) + SET(ITK_DIR ${CMAKE_BINARY_DIR}/${proj}-build) # Since the link directories associated with ITK is used, it makes sens to # update CTK_EXTERNAL_LIBRARY_DIRS with its associated library output directory diff --git a/CMakeExternals/KWStyle.cmake b/CMakeExternals/KWStyle.cmake index 0be8f29500..bf115b97c7 100644 --- a/CMakeExternals/KWStyle.cmake +++ b/CMakeExternals/KWStyle.cmake @@ -16,6 +16,9 @@ IF(CTK_USE_KWSTYLE) IF(NOT DEFINED CTK_KWSTYLE_EXECUTABLE) ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} LIST_SEPARATOR ${sep} CVS_REPOSITORY ":pserver:anoncvs:@public.kitware.com:/cvsroot/KWStyle" CVS_MODULE "KWStyle" diff --git a/CMakeExternals/Log4Qt.cmake b/CMakeExternals/Log4Qt.cmake index 813c02a4d9..7b1c424fb9 100644 --- a/CMakeExternals/Log4Qt.cmake +++ b/CMakeExternals/Log4Qt.cmake @@ -20,6 +20,9 @@ IF(${add_project}) IF(NOT DEFINED Log4Qt_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git" GIT_TAG "origin/patched" CMAKE_GENERATOR ${gen} diff --git a/CMakeExternals/OpenIGTLink.cmake b/CMakeExternals/OpenIGTLink.cmake index ad3df2a6c3..450618fa14 100644 --- a/CMakeExternals/OpenIGTLink.cmake +++ b/CMakeExternals/OpenIGTLink.cmake @@ -21,6 +21,9 @@ IF(${add_project}) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink" INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} @@ -29,7 +32,7 @@ IF(${add_project}) DEPENDS ${proj_DEPENDENCIES} ) - SET(OpenIGTLink_DIR ${ep_build_dir}/${proj}) + SET(OpenIGTLink_DIR ${CMAKE_BINARY_DIR}/${proj}-build) ELSE() ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") diff --git a/CMakeExternals/PythonQt.cmake b/CMakeExternals/PythonQt.cmake index 97402449ef..09075f8b62 100644 --- a/CMakeExternals/PythonQt.cmake +++ b/CMakeExternals/PythonQt.cmake @@ -42,6 +42,9 @@ IF(${add_project}) ENDIF() ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY "${git_protocol}://github.com/commontk/PythonQt.git" GIT_TAG "origin/patched" CMAKE_GENERATOR ${gen} diff --git a/CMakeExternals/PythonQtGenerator.cmake b/CMakeExternals/PythonQtGenerator.cmake index c80242a914..a6bec656e8 100644 --- a/CMakeExternals/PythonQtGenerator.cmake +++ b/CMakeExternals/PythonQtGenerator.cmake @@ -30,13 +30,16 @@ IF(CTK_WRAP_PYTHONQT_FULL) # on the same repository, we will assume that if the directory PythonQt # exists, the generator code will also be available. # - IF(EXISTS ${ep_source_dir}/PythonQt) + IF(EXISTS ${CMAKE_BINARY_DIR}/PythonQt) #MESSAGE(STATUS "ExternalProject/PythonQtGenerator: PythonQt already added as ExternalProject") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} DOWNLOAD_COMMAND "" CMAKE_GENERATOR ${gen} INSTALL_COMMAND "" - SOURCE_DIR ${ep_source_dir}/PythonQt/generator + SOURCE_DIR ${CMAKE_BINARY_DIR}/PythonQt/generator CMAKE_ARGS ${ep_common_args} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} @@ -46,18 +49,21 @@ IF(CTK_WRAP_PYTHONQT_FULL) ELSE() #MESSAGE(STATUS "ExternalProject/PythonQtGenerator: PythonQt is NOT an ExternalProject") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY "${git_protocol}://github.com/commontk/PythonQt.git" GIT_TAG "patched" CMAKE_GENERATOR ${gen} INSTALL_COMMAND "" - SOURCE_DIR ${ep_source_dir}/${proj}/generator + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}/generator CMAKE_ARGS ${ep_common_args} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) ENDIF() - SET(PYTHONQTGENERATOR_EXECUTABLE ${ep_build_dir}/PythonQtGenerator/PythonQtGenerator) + SET(PYTHONQTGENERATOR_EXECUTABLE ${CMAKE_BINARY_DIR}/PythonQtGenerator/PythonQtGenerator) # Since PythonQtGenerator is an executable, there is no need to add its corresponding # library output directory to CTK_EXTERNAL_LIBRARY_DIRS diff --git a/CMakeExternals/QtMobility.cmake b/CMakeExternals/QtMobility.cmake index 8df33282c4..df5ccc9f20 100644 --- a/CMakeExternals/QtMobility.cmake +++ b/CMakeExternals/QtMobility.cmake @@ -20,7 +20,7 @@ IF(${add_project}) ENDIF() # Configure patch script - SET(qtmobility_src_dir ${ep_source_dir}/${proj}) + SET(qtmobility_src_dir ${CMAKE_BINARY_DIR}/${proj}) SET(qtmobility_patch_dir ${CTK_SOURCE_DIR}/Utilities/QtMobility/) SET(qtmobility_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/QtMobility/) SET(qtmobility_patchscript @@ -51,7 +51,7 @@ IF(${add_project}) SET(qtmobility_install_cmd ${qtmobility_make_cmd} install) SET(QTMOBILITY_QTSERVICEFW_INCLUDE_DIR - "${CTK_BINARY_DIR}/CMakeExternals/Source/QtMobility/install/include") + "${CTK_BINARY_DIR}/QtMobility/install/include") SET(QTMOBILITY_QTSERVICEFW_LIBRARY_DEBUG "${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libQtServiceFrameworkd.so") SET(QTMOBILITY_QTSERVICEFW_LIBRARY_RELEASE @@ -68,7 +68,7 @@ IF(${add_project}) SET(qtmobility_servicefw_libname_release libQtServiceFramework.a) ENDIF() - SET(qtmobility_win32_install_prefix "${ep_source_dir}/${proj}/install/") + SET(qtmobility_win32_install_prefix "${CTK_BINARY_DIR}/${proj}/install/") STRING(REPLACE "/" "\\" qtmobility_win32_native_install_prefix ${qtmobility_win32_install_prefix}) SET(qtmobility_config_args -${qtmobility_build_type} -qt ${QT_BINARY_DIR} -prefix ${qtmobility_win32_native_install_prefix} -no-docs -modules ${qtmobility_modules}) @@ -82,6 +82,8 @@ IF(${add_project}) ENDIF() ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + PREFIX ${proj}${ep_suffix} URL ${CTK_SOURCE_DIR}/Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz PATCH_COMMAND ${CMAKE_COMMAND} -P ${qtmobility_patchscript} CONFIGURE_COMMAND /configure ${qtmobility_config_args} diff --git a/CMakeExternals/QtSOAP.cmake b/CMakeExternals/QtSOAP.cmake index bb12dad351..ef9ee0cb5a 100644 --- a/CMakeExternals/QtSOAP.cmake +++ b/CMakeExternals/QtSOAP.cmake @@ -22,6 +22,9 @@ IF(${add_project}) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY "${git_protocol}://github.com/commontk/QtSOAP.git" GIT_TAG "origin/master" CMAKE_GENERATOR ${gen} @@ -32,7 +35,7 @@ IF(${add_project}) DEPENDS ${proj_DEPENDENCIES} ) - SET(QtSOAP_DIR "${ep_build_dir}/${proj}") + SET(QtSOAP_DIR "${CMAKE_BINARY_DIR}/${proj}-build") # Since QtSOAP is statically build, there is not need to add its corresponding # library output directory to CTK_EXTERNAL_LIBRARY_DIRS diff --git a/CMakeExternals/VTK.cmake b/CMakeExternals/VTK.cmake index ea792168a4..e14edd8553 100644 --- a/CMakeExternals/VTK.cmake +++ b/CMakeExternals/VTK.cmake @@ -32,6 +32,9 @@ IF(${add_project} OR CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK) IF(NOT DEFINED VTK_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY ${git_protocol}://vtk.org/VTK.git GIT_TAG "origin/master" INSTALL_COMMAND "" @@ -52,7 +55,7 @@ IF(${add_project} OR CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK) DEPENDS ${proj_DEPENDENCIES} ) - SET(VTK_DIR ${ep_build_dir}/${proj}) + SET(VTK_DIR ${CMAKE_BINARY_DIR}/${proj}-build) # Since the link directories associated with VTK is used, it makes sens to # update CTK_EXTERNAL_LIBRARY_DIRS with its associated library output directory diff --git a/CMakeExternals/XIP.cmake b/CMakeExternals/XIP.cmake index da8aeb7778..082f6fb7b9 100644 --- a/CMakeExternals/XIP.cmake +++ b/CMakeExternals/XIP.cmake @@ -19,6 +19,9 @@ IF(${add_project}) IF(NOT DEFINED XIP_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} SVN_REPOSITORY "https://collab01a.scr.siemens.com/svn/xip/releases/latest" SVN_USERNAME "anonymous" INSTALL_COMMAND "" @@ -28,7 +31,7 @@ IF(${add_project}) -DHAS_VTK:BOOL=OFF -DHAS_ITK:BOOL=OFF ) - SET(XIP_DIR ${ep_build_dir}/${proj}) + SET(XIP_DIR ${CMAKE_BINARY_DIR}/${proj}-build) ELSE() ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") diff --git a/CMakeExternals/ZMQ.cmake b/CMakeExternals/ZMQ.cmake index 7b7ec38839..180f37baff 100644 --- a/CMakeExternals/ZMQ.cmake +++ b/CMakeExternals/ZMQ.cmake @@ -20,6 +20,9 @@ IF(${add_project}) IF(NOT DEFINED ZMQ_DIR) # MESSAGE(STATUS "Adding project:${proj}") ExternalProject_Add(${proj} + SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} + BINARY_DIR ${proj}-build + PREFIX ${proj}${ep_suffix} GIT_REPOSITORY ${git_protocol}://github.com/PatrickCheng/zeromq2.git GIT_TAG "origin/master" INSTALL_COMMAND "" @@ -32,7 +35,7 @@ IF(${add_project}) DEPENDS ${proj_DEPENDENCIES} ) - SET(ZMQ_DIR ${ep_build_dir}/${proj}) + SET(ZMQ_DIR ${CMAKE_BINARY_DIR}/${proj}-build) ELSE() ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") diff --git a/SuperBuild.cmake b/SuperBuild.cmake index e84e64a709..f8510c6cad 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -73,12 +73,11 @@ endif() INCLUDE(ExternalProject) INCLUDE(ctkMacroEmptyExternalProject) -SET(ep_base "${CMAKE_BINARY_DIR}/CMakeExternals") -SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${ep_base}) +#SET(ep_base "${CMAKE_BINARY_DIR}/CMakeExternals") +#SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${ep_base}) -SET(ep_install_dir ${ep_base}/Install) -SET(ep_build_dir ${ep_base}/Build) -SET(ep_source_dir ${ep_base}/Source) +SET(ep_install_dir ${CMAKE_BINARY_DIR}/CMakeExternals/Install) +set(ep_suffix "-cmake") #SET(ep_parallelism_level) SET(ep_build_shared_libs ON) SET(ep_build_testing OFF) @@ -254,7 +253,6 @@ ExternalProject_Add(${proj} ${CTK_DEPENDS} ) - #----------------------------------------------------------------------------- # CTK # diff --git a/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in b/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in index 3f2e1d9e04..1d3f5d41ca 100644 --- a/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in +++ b/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in @@ -1,17 +1,17 @@ # the patch step is run before the update step # so we need to checkout the 1.0 branch here -set(work_dir @ep_source_dir@) +set(work_dir "@CMAKE_BINARY_DIR@") set(proj_dir ${work_dir}/@proj@) -INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionLFtoCRLF.cmake) -INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake) +INCLUDE("@CTK_SOURCE_DIR@/CMake/ctkFunctionLFtoCRLF.cmake") +INCLUDE("@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake") -SET(patch_dir @qtmobility_patch_dir@) -SET(configured_patch_dir @qtmobility_configured_patch_dir@) +SET(patch_dir "@qtmobility_patch_dir@") +SET(configured_patch_dir "@qtmobility_configured_patch_dir@") # Variable required to properly configured the patch files -SET(QT_BINARY_DIR @QT_BINARY_DIR@) +SET(QT_BINARY_DIR "@QT_BINARY_DIR@") SET(patch_files