Commit 568bd735 authored by partyd's avatar partyd
Browse files

ENH: First pass massive reorganization of SuperBuild, splitting each target...

ENH: First pass massive reorganization of SuperBuild, splitting each target into seperate files named External_<target>. COMP: Merge in Changes from Slicer4 branch.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@13323 3bd1e089-480b-0410-8dfb-8563597acbee
parent b5925d7a
This diff is collapsed.
#-----------------------------------------------------------------------------
# Get and build netlib (blas and lapack)
set(proj blas)
set(blas_SVN "http://svn.slicer.org/Slicer3-lib-mirrors/trunk/netlib/BLAS")
set(blas_BUILD_IN_SOURCE 0)
set(blas_CONFIGURE "pwd")
set(blas_BUILD "")
if(WIN32)
else()
set(blas_BUILD_IN_SOURCE 1)
# set(blas_CONFIGURE sh configure)
# set(blas_BUILD ${CMAKE_Fortran_COMPILER} -O3 -fno-second-underscore -fPIC -m64 -c *.f)
# set(blas_INSTAL make install)
endif()
ExternalProject_Add(${proj}
SVN_REPOSITORY ${blas_SVN}
SOURCE_DIR netlib/BLAS
CMAKE_GENERATOR ${gen}
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
# Get and build BatchMake
set(proj BatchMake)
ExternalProject_Add(${proj}
DEPENDS Insight
CVS_REPOSITORY ":pserver:anoncvs:@batchmake.org:/cvsroot/BatchMake"
CVS_MODULE "BatchMake"
SOURCE_DIR BatchMake
BINARY_DIR BatchMake-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
-DUSE_FLTK:BOOL=OFF
-DDASHBOARD_SUPPORT:BOOL=OFF
-DGRID_SUPPORT:BOOL=ON
-DUSE_SPLASHSCREEN:BOOL=OFF
-DITK_DIR:FILEPATH=${CMAKE_BINARY_DIR}/Insight-build
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
# Get and build CTK
set(ctk_source ${CMAKE_BINARY_DIR}/CTK)
if (Slicer3_USE_QT)
ExternalProject_Add(CTK
DEPENDS vtk
GIT_REPOSITORY "git://github.com/pieper/CTK.git"
SOURCE_DIR ${ctk_source}
BINARY_DIR CTK-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DVTK_DIR:PATH=${CMAKE_BINARY_DIR}/VTK-build
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
-DPYTHON_INCLUDE_DIR:PATH=${slicer_PYTHON_INCLUDE}
-DCTK_LIB_Widgets:BOOL=ON
-DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON
-DCTK_LIB_Scripting/Python/Widgets:BOOL=${Slicer3_USE_PYTHONQT}
INSTALL_COMMAND ""
)
endif()
#-----------------------------------------------------------------------------
# Get and build itk
set(proj Insight)
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous:insight@public.kitware.com:/cvsroot/Insight"
CVS_MODULE "Insight"
CVS_TAG -r ITK-3-18
SOURCE_DIR Insight
BINARY_DIR Insight-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DITK_USE_REVIEW:BOOL=ON
-DITK_USE_OPTIMIZED_REGISTRATION_METHODS:BOOL=ON
-DITK_USE_PORTABLE_ROUND:BOOL=ON
-DITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY:BOOL=ON
-DITK_USE_TRANSFORM_IO_FACTORIES:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_SKIP_RPATH:BOOL=ON
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DITK_LEGACY_REMOVE:BOOL=ON
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
# Get and build kwwidgets
set(proj KWWidgets)
set(kwwidgets_tag Slicer-3-6)
ExternalProject_Add(${proj}
DEPENDS vtk
CVS_REPOSITORY ":pserver:anoncvs@www.kwwidgets.org:/cvsroot/KWWidgets"
CVS_MODULE "KWWidgets"
CVS_TAG -r ${kwwidgets_tag}
SOURCE_DIR KWWidgets
BINARY_DIR KWWidgets-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DVTK_DIR:PATH=${CMAKE_BINARY_DIR}/VTK-build
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_SKIP_RPATH:BOOL=ON
-DBUILD_EXAMPLES:BOOL=OFF
-DKWWidgets_BUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DKWWidgets_BUILD_TESTING:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ""
)
set(proj lapack)
ExternalProject_Add(${proj}
SVN_REPOSITORY "http://svn.slicer.org/Slicer3-lib-mirrors/trunk/netlib/lapack-3.1.1"
SOURCE_DIR netlib/lapack
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
# Get and build numpy and scipy
#set ::NUMPY_TAG "http://svn.scipy.org/svn/numpy/branches/1.2.x"
#set ::env(PYTHONHOME) $::Slicer3_LIB/python-build
#set ::env(LD_LIBRARY_PATH) $::Slicer3_LIB/python-build/lib:$::env(LD_LIBRARY_PATH)
set(proj numpy)
set(slicer_PYTHON_INTERPRETER)
if(WIN32)
set(slicer_PYTHON_INTERPRETER ${python_base}/python.exe)
else()
set(slicer_PYTHON_INTERPRETER ${CMAKE_BINARY_DIR}/python-build/bin/python)
set(ENV{LD_LIBRARY_PATH} "${CMAKE_BINARY_DIR}/python-build/lib")
endif()
ExternalProject_Add(${proj}
DEPENDS blas lapack python
SVN_REPOSITORY "http://svn.scipy.org/svn/numpy/branches/1.3.x"
SOURCE_DIR python/numpy
CONFIGURE_COMMAND ""
BINARY_DIR ${CMAKE_BINARY_DIR}/python/numpy
BUILD_COMMAND ${slicer_PYTHON_INTERPRETER} ./setup.py install
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
# Get and build OpenIGTLink
set(proj OpenIGTLink)
ExternalProject_Add(${proj}
SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/branches/OpenIGTLink-1-0"
SOURCE_DIR OpenIGTLink
BINARY_DIR OpenIGTLink-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_SKIP_RPATH:BOOL=ON
-DOpenIGTLink_DIR:FILEPATH=${CMAKE_BINARY_DIR}/OpenIGTLink-build
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
set(proj python)
set(python_DEPENDS )
if(Slicer3_USE_PYTHON)
list(APPEND python_DEPENDS tcl tk)
endif(Slicer3_USE_PYTHON)
if(WIN32)
set(python_sln ${CMAKE_BINARY_DIR}/${proj}-build/PCbuild/pcbuild.sln)
string(REPLACE "/" "\\" python_sln ${python_sln})
# point the tkinter build file to the slicer tcl-build
get_filename_component(python_base ${python_sln} PATH)
get_filename_component(python_home ${python_base} PATH)
set(python_tkinter ${python_base}/pyproject.vsprops)
string(REPLACE "/" "\\" python_tkinter ${python_tkinter})
set(script ${CMAKE_CURRENT_SOURCE_DIR}/StringFindReplace.cmake)
set(out ${python_tkinter})
set(in ${python_tkinter})
ExternalProject_Add(${proj}
DEPENDS ${python_DEPENDS}
SVN_REPOSITORY "http://svn.python.org/projects/python/branches/release26-maint"
SOURCE_DIR python-build
UPDATE_COMMAND ""
PATCH_COMMAND ${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=tcltk\" -Dreplace=tcl-build\" -P ${script}
CONFIGURE_COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /Upgrade
BUILD_COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project select
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)
# this must match the version of tcl we are building for slicer.
ExternalProject_Add_Step(${proj} Patch_tcltk_version
COMMAND ${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=85 -Dreplace=84 -P ${script}
DEPENDEES configure
DEPENDERS build
)
ExternalProject_Add_Step(${proj} Build_make_versioninfo
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project make_versioninfo
DEPENDEES configure
)
ExternalProject_Add_Step(${proj} Build_make_buildinfo
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project make_buildinfo
DEPENDEES Build_make_versioninfo
)
ExternalProject_Add_Step(${proj} Build_kill_python
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project kill_python
DEPENDEES Build_kill_python
)
ExternalProject_Add_Step(${proj} Build_w9xpopen
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project w9xpopen
DEPENDEES Build_kill_python
)
ExternalProject_Add_Step(${proj} Build_pythoncore
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project pythoncore
DEPENDEES Build_w9xpopen
)
ExternalProject_Add_Step(${proj} Build__socket
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _socket
DEPENDEES Build_pythoncore
)
ExternalProject_Add_Step(${proj} Build__tkinter
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _tkinter
DEPENDEES Build__socket
)
ExternalProject_Add_Step(${proj} Build__testcapi
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _testcapi
DEPENDEES Build__tkinter
)
ExternalProject_Add_Step(${proj} Build__msi
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _msi
DEPENDEES Build__testcapi
)
ExternalProject_Add_Step(${proj} Build__elementtree
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _elementtree
DEPENDEES Build__msi
)
ExternalProject_Add_Step(${proj} Build__ctypes_test
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _ctypes_test
DEPENDEES Build__elementtree
)
ExternalProject_Add_Step(${proj} Build__ctypes
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _ctypes
DEPENDEES python_sln
)
ExternalProject_Add_Step(${proj} Build_winsound
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project winsound
DEPENDEES Build__ctypes
)
ExternalProject_Add_Step(${proj} Build_pyexpat
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project pyexpat
DEPENDEES Build_winsound
)
ExternalProject_Add_Step(${proj} Build_pythonw
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project pythonw
DEPENDEES Build_pyexpat
)
ExternalProject_Add_Step(${proj} Build__multiprocessing
COMMAND ${CMAKE_BUILD_TOOL} ${python_sln} /build Release /project _multiprocessing
DEPENDEES Build_pythonw
)
ExternalProject_Add_Step(${proj} CopyPythonLib
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/python-build/PCbuild/python26.lib ${CMAKE_BINARY_DIR}/python-build/Lib/python26.lib
DEPENDEES install
)
ExternalProject_Add_Step(${proj} Copy_socketPyd
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/python-build/PCbuild/_socket.pyd ${CMAKE_BINARY_DIR}/python-build/Lib/_socket.pyd
DEPENDEES install
)
ExternalProject_Add_Step(${proj} Copy_ctypesPyd
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/python-build/PCbuild/_ctypes.pyd ${CMAKE_BINARY_DIR}/python-build/Lib/_ctypes.pyd
DEPENDEES install
)
ExternalProject_Add_Step(${proj} CopyPythonDll
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/python-build/PCbuild/python26.dll ${CMAKE_BINARY_DIR}/Slicer3-build/bin/${CMAKE_BUILD_TYPE}/python26.dll
DEPENDEES install
)
elseif(APPLE)
set(python_SVN "http://svn.python.org/projects/python/branches/release26-maint")
set(python_BUILD_IN_SOURCE 1)
set(python_CONFIGURE sh configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/python-build --with-tcl=${tcl_build} --enable-shared)
set(python_BUILD make)
set(python_INSTALL make install)
ExternalProject_Add(${proj}
DEPENDS ${python_DEPENDS}
SVN_REPOSITORY ${python_SVN}
SOURCE_DIR python
BUILD_IN_SOURCE ${python_BUILD_IN_SOURCE}
CONFIGURE_COMMAND ${python_CONFIGURE}
BUILD_COMMAND ${python_BUILD}
INSTALL_COMMAND ${python_INSTALL}
)
# if { $isDarwin } {
# # Special Slicer hack to build and install the .dylib
# file mkdir $::Slicer3_LIB/python-build/lib/
# file delete -force $::Slicer3_LIB/python-build/lib/libpython2.6.dylib
# set fid [open environhack.c w]
# puts $fid "char **environ=0;"
# close $fid
# runcmd gcc -c -o environhack.o environhack.c
# runcmd libtool -o $::Slicer3_LIB/python-build/lib/libpython2.6.dylib -dynamic \
# -all_load libpython2.6.a environhack.o -single_module \
# -install_name $::Slicer3_LIB/python-build/lib/libpython2.6.dylib \
# -compatibility_version 2.6 \
# -current_version 2.6 -lSystem -lSystemStubs
#
#
else()
set(python_SVN "http://svn.python.org/projects/python/branches/release26-maint")
set(python_BUILD_IN_SOURCE 1)
set(python_CONFIGURE sh configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/python-build --with-tcl=${tcl_build} --enable-shared)
set(python_BUILD make)
set(python_INSTALL make install)
ExternalProject_Add(${proj}
DEPENDS ${python_DEPENDS}
SVN_REPOSITORY ${python_SVN}
SOURCE_DIR python
BUILD_IN_SOURCE ${python_BUILD_IN_SOURCE}
CONFIGURE_COMMAND ${python_CONFIGURE}
BUILD_COMMAND ${python_BUILD}
INSTALL_COMMAND ${python_INSTALL}
)
endif()
#-----------------------------------------------------------------------------
# Set vtk_PYTHON_ARGS, slicer_PYTHON_INCLUDE and slicer_PYTHON_LIBRARY variables
#
set(vtk_PYTHON_ARGS)
set(slicer_PYTHON_INCLUDE)
set(slicer_PYTHON_LIBRARY)
set(slicer_PYTHON_EXECUTABLE)
if(WIN32)
set(slicer_PYTHON_INCLUDE ${CMAKE_BINARY_DIR}/Python-build/Include)
set(slicer_PYTHON_LIBRARY ${CMAKE_BINARY_DIR}/Python-build/PCbuild/python26.lib)
set(slicer_PYTHON_EXECUTABLE ${CMAKE_BINARY_DIR}/Python-build/PCbuild/python.exe)
elseif(APPLE)
set(slicer_PYTHON_INCLUDE ${CMAKE_BINARY_DIR}/python-build/include/python2.6)
set(slicer_PYTHON_LIBRARY ${CMAKE_BINARY_DIR}/python-build/lib/libpython2.6.dylib)
set(slicer_PYTHON_EXECUTABLE ${CMAKE_BINARY_DIR}/python-build/bin/python)
else()
set(slicer_PYTHON_INCLUDE ${CMAKE_BINARY_DIR}/python-build/include/python2.6)
set(slicer_PYTHON_LIBRARY ${CMAKE_BINARY_DIR}/python-build/lib/libpython2.6.so)
set(slicer_PYTHON_EXECUTABLE ${CMAKE_BINARY_DIR}/python-build/bin/python)
endif()
if(Slicer3_USE_PYTHON)
set(vtk_PYTHON_ARGS
-DPYTHON_INCLUDE_PATH:PATH=${slicer_PYTHON_INCLUDE}
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
)
endif(Slicer3_USE_PYTHON)
#-----------------------------------------------------------------------------
# PythonQT
#
set(proj PythonQt)
find_program(Slicer3_PATCH_EXECUTABLE patch
"C:/Program Files/GnuWin32/bin"
"C:/Program Files (x86)/GnuWin32/bin")
mark_as_advanced(Slicer3_PATCH_EXECUTABLE)
if (NOT Slicer3_PATCH_EXECUTABLE)
message(FATAL_ERROR "Building PythonQt requires a patch program. Please set Slicer3_PATCH_EXECUTABLE!")
endif()
set(pythonqt_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${proj}")
set(pythonqt_patches_dir "${CMAKE_CURRENT_SOURCE_DIR}/../Utilities/Patches/PythonQt")
set(pythonqt_patch_script "${CMAKE_CURRENT_BINARY_DIR}/Slicer3-build/CMake/Slicer3PatchPythonQt.cmake")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/Slicer3PatchPythonQt.cmake.in ${pythonqt_patch_script} @ONLY)
ExternalProject_Add(${proj}
DEPENDS python
SVN_REPOSITORY "https://pythonqt.svn.sourceforge.net/svnroot/pythonqt/trunk"
SOURCE_DIR PythonQt
PATCH_COMMAND ${CMAKE_COMMAND} -P ${pythonqt_patch_script}
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
#-DCMAKE_INSTALL_PREFIX:PATH=${prefix}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
${vtk_PYTHON_ARGS}
INSTALL_COMMAND "")
set(proj scipy)
ExternalProject_Add(${proj}
DEPENDS numpy
SVN_REPOSITORY "http://svn.scipy.org/svn/scipy/branches/0.7.x"
SOURCE_DIR python/scipy
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
#-----------------------------------------------------------------------------
set(tcl_build)
set(proj tcl)
set(tcl_SVN_REPOSITORY)
set(tcl_SOURCE_DIR "")
set(tcl_BINARY_DIR "")
set(tcl_BUILD_IN_SOURCE 0)
set(tcl_CONFIGURE_COMMAND "")
set(tcl_BUILD_COMMAND "")
set(tcl_INSTALL_COMMAND "")
set(tcl_base ${CMAKE_CURRENT_BINARY_DIR}/tcl)
set(tcl_build ${CMAKE_CURRENT_BINARY_DIR}/tcl-build)
if(WIN32)
set(tcl_SVN_REPOSITORY "http://svn.slicer.org/Slicer3-lib-mirrors/trunk/Binaries/Windows/tcl-build")
set(tcl_SOURCE_DIR tcl-build)
else()
set(tcl_SVN_REPOSITORY "http://svn.slicer.org/Slicer3-lib-mirrors/trunk/tcl/tcl")
set(tcl_SOURCE_DIR tcl/tcl)
set(tcl_BUILD_IN_SOURCE 1)
# configure, make and make install all need to be executed in tcl/unix. External_Project
# doesn't provide any way to set the working directory for each step so we do so by
# configuring a script that has an execute_process command that has the correct working
# directory
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_configure_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tcl_configure_step.cmake
@ONLY)
set(tcl_CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_configure_step.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_make_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tcl_make_step.cmake
@ONLY)
set(tcl_BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_make_step.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_install_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tcl_install_step.cmake
@ONLY)
set(tcl_INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_install_step.cmake)
endif()
ExternalProject_Add(${proj}
SVN_REPOSITORY ${tcl_SVN_REPOSITORY}
SOURCE_DIR ${tcl_SOURCE_DIR}
BUILD_IN_SOURCE ${tcl_BUILD_IN_SOURCE}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${tcl_CONFIGURE_COMMAND}
BUILD_COMMAND ${tcl_BUILD_COMMAND}
INSTALL_COMMAND ${tcl_INSTALL_COMMAND}
)
#-----------------------------------------------------------------------------
set(proj tk)
set(tk_SVN_REPOSITORY "http://svn.slicer.org/Slicer3-lib-mirrors/trunk/tcl/tk")
set(tk_SOURCE_DIR "")
set(tk_BINARY_DIR "")
set(tk_BUILD_IN_SOURCE 0)
set(tk_CONFIGURE_COMMAND "")
set(tk_BUILD_COMMAND "")
set(tk_INSTALL_COMMAND "")
if(NOT WIN32)
set(tk_SOURCE_DIR tcl/tk)
set(tk_BUILD_IN_SOURCE 1)
# configure, make and make install all need to be executed in tk/unix. External_Project
# doesn't provide any way to set the working directory for each step so we do so by
# configuring a script that has an execute_process command that has the correct working
# directory
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tk_configure_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tk_configure_step.cmake
@ONLY)
set(tk_CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tk_configure_step.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tk_make_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tk_make_step.cmake
@ONLY)
set(tk_BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tk_make_step.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tk_install_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tk_install_step.cmake
@ONLY)
set(tk_INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tk_install_step.cmake)
endif()
if(NOT WIN32)
ExternalProject_Add(${proj}
DEPENDS tcl
SVN_REPOSITORY ${tk_SVN_REPOSITORY}
SOURCE_DIR ${tk_SOURCE_DIR}
UPDATE_COMMAND ""
BUILD_IN_SOURCE ${tk_BUILD_IN_SOURCE}
CONFIGURE_COMMAND ${tk_CONFIGURE_COMMAND}
BUILD_COMMAND ${tk_BUILD_COMMAND}
INSTALL_COMMAND ${tk_INSTALL_COMMAND}
)
ExternalProject_Add_Step(${proj} Install_default.h
COMMAND ${CMAKE_COMMAND} -E copy ${tcl_base}/tk/generic/default.h ${tcl_build}/include
DEPENDEES install
)
ExternalProject_Add_Step(${proj} Install_tkUnixDefault.h
COMMAND ${CMAKE_COMMAND} -E copy ${tcl_base}/tk/unix/tkUnixDefault.h ${tcl_build}/include
DEPENDEES install
)
endif()
#-----------------------------------------------------------------------------
# Get and build VTK
#
set(proj VTK)
set(vtk_source ${CMAKE_BINARY_DIR}/VTK)
set(vtk_DEPENDS)
set(vtk_WRAP_TCL OFF)
set(vtk_WRAP_PYTHON OFF)
if(Slicer3_USE_KWWIDGETS)
list(APPEND vtk_DEPENDS tcl)
set(vtk_WRAP_TCL ON)
endif(Slicer3_USE_KWWIDGETS)
if (Slicer3_USE_PYTHONQT)
set(vtk_WRAP_PYTHON ON)
list(APPEND vtk_DEPENDS python)
endif(Slicer3_USE_PYTHONQT)
set(vtk_QT_ARGS)
if(Slicer3_USE_QT)