Skip to content

Commit

Permalink
Update source and build directory associated with external project
Browse files Browse the repository at this point in the history
Doing so will decrease the average length of external project path
associated with CTK.

If needed, make the "cleaning" of external project easier
"rm VTK*" instead of "cd" in each CMakeExternals sub folders ..
  • Loading branch information
jcfr committed May 15, 2011
1 parent b21f604 commit 2c6c55f
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 35 deletions.
5 changes: 4 additions & 1 deletion CMakeExternals/CTKData.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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()
Expand Down
21 changes: 12 additions & 9 deletions CMakeExternals/DCMTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions CMakeExternals/KWStyle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions CMakeExternals/Log4Qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/OpenIGTLink.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}")
Expand Down
3 changes: 3 additions & 0 deletions CMakeExternals/PythonQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 10 additions & 4 deletions CMakeExternals/PythonQtGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions CMakeExternals/QtMobility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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})
Expand All @@ -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 <SOURCE_DIR>/configure ${qtmobility_config_args}
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/QtSOAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/XIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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}")
Expand Down
5 changes: 4 additions & 1 deletion CMakeExternals/ZMQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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}")
Expand Down
10 changes: 4 additions & 6 deletions SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -254,7 +253,6 @@ ExternalProject_Add(${proj}
${CTK_DEPENDS}
)


#-----------------------------------------------------------------------------
# CTK
#
Expand Down
12 changes: 6 additions & 6 deletions Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 2c6c55f

Please sign in to comment.