Commit 759ed76e authored by jcfr's avatar jcfr
Browse files

COMP: Superbuild - Possible to provide external VTK, ITK or CTK - Project name are now consistent,

At the superbuild level, it's now possible to pass ITK_DIR, CTK_DIR
or VTK_DIR/VTK_SOURCE_DIR.

The developer has to make sure the directory match the expected
configuration (wrapping, options ... )

This is useful when feature are developed locally on either CTK / VTK  / ITK
and the developer doesn't want to commit to a repository each time
he would like to see he obtain the expected behavior within slicer.

Variable name, build dir, source dir are also now identified using the same
prefix.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@13780 3bd1e089-480b-0410-8dfb-8563597acbee
parent f4ffafb5
......@@ -321,22 +321,22 @@ if(Slicer3_USE_KWWIDGETS)
set(python_DEPENDENCIES tk)
endif()
endif()
set(clapack_DEPENDENCIES)
set(numpy_DEPENDENCIES CLAPACK python)
set(CLAPACK_DEPENDENCIES)
set(NUMPY_DEPENDENCIES CLAPACK python)
set(scipy_DEPENDENCIES NUMPY)
set(vtk_DEPENDENCIES)
set(CTK_DEPENDENCIES vtk)
set(VTK_DEPENDENCIES)
set(CTK_DEPENDENCIES VTK)
if(Slicer3_USE_PYTHONQT)
list(APPEND CTK_DEPENDENCIES python)
endif()
set(KWWidgets_DEPENDENCIES vtk)
set(KWWidgets_DEPENDENCIES VTK)
set(Insight_DEPENDENCIES)
set(BatchMake_DEPENDENCIES Insight)
set(OpenIGTLink_DEPENDENCIES)
set(teem_DEPENDENCIES vtk)
set(teem_DEPENDENCIES VTK)
set(cmcurl_DEPENDENCIES)
set(slicer_DEPENDENCIES vtk Insight BatchMake OpenIGTLink teem cmcurl)
set(slicer_DEPENDENCIES VTK Insight BatchMake OpenIGTLink teem cmcurl)
#------------------------------------------------------------------------------
# Conditionnaly include ExternalProject Target
......@@ -408,7 +408,7 @@ endif()
# List of external projects
#------------------------------------------------------------------------------
set(external_project_list tk tcl incrTcl iwidgets blt python clapack numpy scipy vtk CTK KWWidgets Insight BatchMake OpenIGTLink teem cmcurl slicer)
set(external_project_list tk tcl incrTcl iwidgets blt python CLAPACK NUMPY scipy VTK CTK KWWidgets Insight BatchMake OpenIGTLink teem cmcurl slicer)
#-----------------------------------------------------------------------------
# Dump external project dependencies
......@@ -440,7 +440,7 @@ ExternalProject_Add(${proj}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=ON
# ITK
-DITK_DIR:PATH=${CMAKE_BINARY_DIR}/Insight-build
-DITK_DIR:PATH=${ITK_DIR}
# Teem
-DTeem_DIR:PATH=${CMAKE_BINARY_DIR}/teem-build
# OpenIGTLink
......@@ -450,7 +450,7 @@ ExternalProject_Add(${proj}
-DSlicer3_USE_BatchMake=ON
-DBatchMake_DIR:PATH=${CMAKE_BINARY_DIR}/BatchMake-build
# VTK
-DVTK_DIR:PATH=${CMAKE_BINARY_DIR}/VTK-build
-DVTK_DIR:PATH=${VTK_DIR}
-DVTK_DEBUG_LEAKS:BOOL=${Slicer3_USE_VTK_DEBUG_LEAKS}
# TCL/Tk
-DINCR_TCL_LIBRARY:FILEPATH=${slicer_TCL_LIB}
......@@ -469,7 +469,7 @@ ExternalProject_Add(${proj}
# Qt
-DSlicer3_USE_QT:BOOL=${Slicer3_USE_QT}
-DQT_QMAKE_EXECUTABLE:PATH=${QT_QMAKE_EXECUTABLE}
-DCTK_DIR:PATH=${CMAKE_BINARY_DIR}/CTK-build
-DCTK_DIR:PATH=${CTK_DIR}
# KWWidgets
-DSlicer3_USE_KWWIDGETS:BOOL=${Slicer3_USE_KWWIDGETS}
-DKWWidgets_DIR:PATH=${CMAKE_BINARY_DIR}/KWWidgets-build
......
......@@ -19,6 +19,6 @@ ExternalProject_Add(${proj}
-DDASHBOARD_SUPPORT:BOOL=OFF
-DGRID_SUPPORT:BOOL=ON
-DUSE_SPLASHSCREEN:BOOL=OFF
-DITK_DIR:FILEPATH=${CMAKE_BINARY_DIR}/Insight-build
-DITK_DIR:FILEPATH=${ITK_DIR}
INSTALL_COMMAND ""
)
set(clapack_version 3.2.1)
#set(clapack_file "http://www.netlib.org/clapack/clapack-${clapack_version}-CMAKE.tgz")
set(CLAPACK_version 3.2.1)
#set(CLAPACK_file "http://www.netlib.org/clapack/clapack-${clapack_version}-CMAKE.tgz")
# Since the netlib.org server has been down several time, especially when the nightly dashboard
# started, we added a copy of the archive to slicer3 lib mirrors.
set(clapack_file http://svn.slicer.org/Slicer3-lib-mirrors/trunk/clapack-${clapack_version}-CMAKE.tgz)
set(CLAPACK_file http://svn.slicer.org/Slicer3-lib-mirrors/trunk/clapack-${CLAPACK_version}-CMAKE.tgz)
# The CLAPACK external project for Titan
set(clapack_source "${CMAKE_CURRENT_BINARY_DIR}/CLAPACK")
set(clapack_binary "${CMAKE_CURRENT_BINARY_DIR}/CLAPACK-build")
# turn off the warnings for clapack on windows
set(CLAPACK_source "${CMAKE_CURRENT_BINARY_DIR}/CLAPACK")
set(CLAPACK_binary "${CMAKE_CURRENT_BINARY_DIR}/CLAPACK-build")
# turn off the warnings for CLAPACK on windows
string(REPLACE "/W3" "/W0" CMAKE_CXX_FLAGS_CLAPACK "${CMAKE_CXX_FLAGS}")
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS_CLAPACK
"${CMAKE_CXX_FLAGS_CLAPACK}")
......@@ -18,9 +18,9 @@ string(REPLACE "/W4" "/W0" CMAKE_C_FLAGS_CLAPACK
"${CMAKE_C_FLAGS_CLAPACK}")
ExternalProject_Add(CLAPACK
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${clapack_source}
BINARY_DIR ${clapack_binary}
URL ${clapack_file}
SOURCE_DIR ${CLAPACK_source}
BINARY_DIR ${CLAPACK_binary}
URL ${CLAPACK_file}
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS_CLAPACK}
......@@ -28,8 +28,8 @@ ExternalProject_Add(CLAPACK
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ""
DEPENDS ${clapack_DEPENDENCIES}
DEPENDS ${CLAPACK_DEPENDENCIES}
)
set(CLAPACK_DIR "${clapack_binary}" CACHE PATH
set(CLAPACK_DIR "${CLAPACK_binary}" CACHE PATH
"CLAPACK binary directory" FORCE)
mark_as_advanced(CLAPACK_DIR)
#-----------------------------------------------------------------------------
# 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}
-DCTK_LIB_PluginFramework:BOOL=OFF
-DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF
INSTALL_COMMAND ""
)
# Sanity checks
if(DEFINED CTK_DIR AND NOT EXISTS ${CTK_DIR})
message(FATAL_ERROR "CTK_DIR variable is defined but corresponds to non-existing directory")
endif()
if(NOT DEFINED CTK_DIR)
set(proj CTK)
# message(STATUS "Adding project:${proj}")
ExternalProject_Add(${proj}
GIT_REPOSITORY "git://github.com/pieper/CTK.git"
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
BINARY_DIR ${proj}-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=${VTK_DIR}
-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}
-DCTK_LIB_PluginFramework:BOOL=OFF
-DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF
INSTALL_COMMAND ""
DEPENDS ${CTK_DEPENDENCIES}
)
set(CTK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
endif()
endif()
......@@ -2,32 +2,40 @@
#-----------------------------------------------------------------------------
# Get and build itk
set(proj Insight)
# Sanity checks
if(DEFINED ITK_DIR AND NOT EXISTS ${ITK_DIR})
message(FATAL_ERROR "ITK_DIR variable is defined but corresponds to non-existing directory")
endif()
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous:insight@public.kitware.com:/cvsroot/Insight"
CVS_MODULE "Insight"
CVS_TAG -r ITK-3-18
UPDATE_COMMAND ""
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 ""
)
if(NOT DEFINED ITK_DIR)
set(proj Insight)
# message(STATUS "Adding project:${proj}")
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous:insight@public.kitware.com:/cvsroot/Insight"
CVS_MODULE "Insight"
CVS_TAG -r ITK-3-18
UPDATE_COMMAND ""
SOURCE_DIR ${proj}
BINARY_DIR ${proj}-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 ""
)
set(ITK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
endif()
......@@ -17,7 +17,7 @@ ExternalProject_Add(${proj}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DVTK_DIR:PATH=${CMAKE_BINARY_DIR}/VTK-build
-DVTK_DIR:PATH=${VTK_DIR}
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_SKIP_RPATH:BOOL=ON
-DBUILD_EXAMPLES:BOOL=OFF
......
# The Numpy external project
set(numpy_binary "${CMAKE_CURRENT_BINARY_DIR}/NUMPY/")
set(NUMPY_binary "${CMAKE_CURRENT_BINARY_DIR}/NUMPY/")
# to configure numpy we run a cmake -P script
# the script will create a site.cfg file
......@@ -30,5 +30,5 @@ ExternalProject_Add(NUMPY
-P ${CMAKE_CURRENT_BINARY_DIR}/NUMPY_make_step.cmake
UPDATE_COMMAND ""
INSTALL_COMMAND ""
DEPENDS ${numpy_DEPENDENCIES}
DEPENDS ${NUMPY_DEPENDENCIES}
)
......@@ -2,133 +2,147 @@
# Get and build VTK
#
set(proj VTK)
# Sanity checks
if(DEFINED VTK_DIR AND NOT EXISTS ${VTK_DIR})
message(FATAL_ERROR "VTK_DIR variable is defined but corresponds to non-existing directory")
endif()
set(vtk_source ${CMAKE_BINARY_DIR}/VTK)
set(vtk_WRAP_TCL OFF)
set(vtk_WRAP_PYTHON OFF)
if(DEFINED VTK_SOURCE_DIR AND NOT EXISTS ${VTK_SOURCE_DIR})
message(FATAL_ERROR "VTK_SOURCE_DIR variable is defined but corresponds to non-existing directory")
endif()
if(Slicer3_USE_KWWIDGETS)
list(APPEND vtk_DEPENDENCIES tcl)
if (NOT WIN32)
list(APPEND vtk_DEPENDENCIES tk)
endif(NOT WIN32)
set(vtk_WRAP_TCL ON)
endif(Slicer3_USE_KWWIDGETS)
if(NOT DEFINED VTK_DIR OR NOT DEFINED VTK_SOURCE_DIR)
if (Slicer3_USE_PYTHONQT)
set(vtk_WRAP_PYTHON ON)
list(APPEND vtk_DEPENDENCIES python)
endif(Slicer3_USE_PYTHONQT)
set(proj VTK)
# message(STATUS "Adding project:${proj}")
set(vtk_PYTHON_ARGS)
if(Slicer3_USE_PYTHON OR Slicer3_USE_PYTHONQT)
set(vtk_PYTHON_ARGS
-DPYTHON_INCLUDE_DIR:PATH=${slicer_PYTHON_INCLUDE}
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
)
endif(Slicer3_USE_PYTHON OR Slicer3_USE_PYTHONQT)
set(VTK_WRAP_TCL OFF)
set(VTK_WRAP_PYTHON OFF)
# On Mac, since:
# - Qt can't be build with X11 support
# - KWWidgets only support X11
# the case where both Slicer3_USE_QT and Slicer3_USE_KWWIDGETS are ON is *NOT* supported
if(Slicer3_USE_KWWIDGETS)
list(APPEND VTK_DEPENDENCIES tcl)
if (NOT WIN32)
list(APPEND VTK_DEPENDENCIES tk)
endif(NOT WIN32)
set(VTK_WRAP_TCL ON)
endif(Slicer3_USE_KWWIDGETS)
set(vtk_QT_ARGS)
if(NOT APPLE)
if(Slicer3_USE_QT)
set(vtk_QT_ARGS
-DDESIRED_QT_VERSION:STRING=4
-DVTK_USE_GUISUPPORT:BOOL=ON
-DVTK_USE_QVTK_QTOPENGL:BOOL=ON
-DVTK_USE_QT:BOOL=ON
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
)
endif(Slicer3_USE_QT)
else()
if(Slicer3_USE_KWWIDGETS AND NOT Slicer3_USE_QT)
set(vtk_QT_ARGS
-DCMAKE_SHARED_LINKER_FLAGS:STRING="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
-DCMAKE_EXE_LINKER_FLAGS:STRING="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
-DOPENGL_INCLUDE_DIR:PATH=/usr/X11R6/include
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=OFF
-DVTK_USE_X:BOOL=ON
-DVTK_USE_RPATH:BOOL=ON
-DVTK_USE_GUISUPPORT:BOOL=OFF
-DVTK_USE_QVTK_QTOPENGL:BOOL=OFF
-DVTK_USE_QT:BOOL=OFF
)
elseif(NOT Slicer3_USE_KWWIDGETS AND Slicer3_USE_QT)
set(vtk_QT_ARGS
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=ON # Default to Cocoa, VTK/CMakeLists.txt will enable Carbon and disable cocoa if needed
-DVTK_USE_X:BOOL=OFF
-DVTK_USE_RPATH:BOOL=ON
-DDESIRED_QT_VERSION:STRING=4
-DVTK_USE_GUISUPPORT:BOOL=ON
-DVTK_USE_QVTK_QTOPENGL:BOOL=ON
-DVTK_USE_QT:BOOL=ON
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
if (Slicer3_USE_PYTHONQT)
set(VTK_WRAP_PYTHON ON)
list(APPEND VTK_DEPENDENCIES python)
endif(Slicer3_USE_PYTHONQT)
set(VTK_PYTHON_ARGS)
if(Slicer3_USE_PYTHON OR Slicer3_USE_PYTHONQT)
set(VTK_PYTHON_ARGS
-DPYTHON_INCLUDE_DIR:PATH=${slicer_PYTHON_INCLUDE}
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
)
elseif(Slicer3_USE_KWWIDGETS AND Slicer3_USE_QT)
MESSAGE(FATAL_ERROR "Case where Slicer3_USE_QT and Slicer3_USE_KWWIDGETS are ON is not supported on MAC")
endif()
endif()
endif(Slicer3_USE_PYTHON OR Slicer3_USE_PYTHONQT)
# Disable Tk when Python wrapping is enabled
if (Slicer3_USE_PYTHONQT)
list(APPEND vtk_QT_ARGS -DVTK_USE_TK:BOOL=OFF)
endif()
# On Mac, since:
# - Qt can't be build with X11 support
# - KWWidgets only support X11
# the case where both Slicer3_USE_QT and Slicer3_USE_KWWIDGETS are ON is *NOT* supported
set(slicer_TCL_LIB)
set(slicer_TK_LIB)
set(slicer_TCLSH)
set(vtk_TCL_ARGS)
if(vtk_WRAP_TCL)
if(WIN32)
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/tcl84.lib)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/tk84.lib)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh.exe)
elseif(APPLE)
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtcl8.4.dylib)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtk8.4.dylib)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh84)
set(VTK_QT_ARGS)
if(NOT APPLE)
if(Slicer3_USE_QT)
set(VTK_QT_ARGS
-DDESIRED_QT_VERSION:STRING=4
-DVTK_USE_GUISUPPORT:BOOL=ON
-DVTK_USE_QVTK_QTOPENGL:BOOL=ON
-DVTK_USE_QT:BOOL=ON
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
)
endif(Slicer3_USE_QT)
else()
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtcl8.4.so)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtk8.4.so)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh84)
if(Slicer3_USE_KWWIDGETS AND NOT Slicer3_USE_QT)
set(VTK_QT_ARGS
-DCMAKE_SHARED_LINKER_FLAGS:STRING="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
-DCMAKE_EXE_LINKER_FLAGS:STRING="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
-DOPENGL_INCLUDE_DIR:PATH=/usr/X11R6/include
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=OFF
-DVTK_USE_X:BOOL=ON
-DVTK_USE_RPATH:BOOL=ON
-DVTK_USE_GUISUPPORT:BOOL=OFF
-DVTK_USE_QVTK_QTOPENGL:BOOL=OFF
-DVTK_USE_QT:BOOL=OFF
)
elseif(NOT Slicer3_USE_KWWIDGETS AND Slicer3_USE_QT)
set(VTK_QT_ARGS
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=ON # Default to Cocoa, VTK/CMakeLists.txt will enable Carbon and disable cocoa if needed
-DVTK_USE_X:BOOL=OFF
-DVTK_USE_RPATH:BOOL=ON
-DDESIRED_QT_VERSION:STRING=4
-DVTK_USE_GUISUPPORT:BOOL=ON
-DVTK_USE_QVTK_QTOPENGL:BOOL=ON
-DVTK_USE_QT:BOOL=ON
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
)
elseif(Slicer3_USE_KWWIDGETS AND Slicer3_USE_QT)
MESSAGE(FATAL_ERROR "Case where Slicer3_USE_QT and Slicer3_USE_KWWIDGETS are ON is not supported on MAC")
endif()
endif()
set(vtk_TCL_ARGS
-DTCL_INCLUDE_PATH:PATH=${CMAKE_BINARY_DIR}/tcl-build/include
-DTK_INCLUDE_PATH:PATH=${CMAKE_BINARY_DIR}/tcl-build/include
-DTCL_LIBRARY:FILEPATH=${slicer_TCL_LIB}
-DTK_LIBRARY:FILEPATH=${slicer_TK_LIB}
-DTCL_TCLSH:FILEPATH=${slicer_TCLSH}
)
endif(vtk_WRAP_TCL)
ExternalProject_Add(vtk
DEPENDS ${vtk_DEPENDENCIES}
SOURCE_DIR ${vtk_source}
BINARY_DIR VTK-build
GIT_REPOSITORY "git://github.com/pieper/SlicerVTK.git"
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_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DVTK_USE_PARALLEL:BOOL=ON
-DVTK_DEBUG_LEAKS:BOOL=${Slicer3_USE_VTK_DEBUG_LEAKS}
-DVTK_WRAP_TCL:BOOL=${vtk_WRAP_TCL}
-DVTK_USE_RPATH:BOOL=ON
${vtk_TCL_ARGS}
-DVTK_WRAP_PYTHON:BOOL=${vtk_WRAP_PYTHON}
${vtk_PYTHON_ARGS}
${vtk_QT_ARGS}
${vtk_MAC_ARGS}
INSTALL_COMMAND ""
)
# Disable Tk when Python wrapping is enabled
if (Slicer3_USE_PYTHONQT)
list(APPEND VTK_QT_ARGS -DVTK_USE_TK:BOOL=OFF)
endif()
set(slicer_TCL_LIB)
set(slicer_TK_LIB)
set(slicer_TCLSH)
set(VTK_TCL_ARGS)
if(VTK_WRAP_TCL)
if(WIN32)
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/tcl84.lib)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/tk84.lib)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh.exe)
elseif(APPLE)
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtcl8.4.dylib)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtk8.4.dylib)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh84)
else()
set(slicer_TCL_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtcl8.4.so)
set(slicer_TK_LIB ${CMAKE_BINARY_DIR}/tcl-build/lib/libtk8.4.so)
set(slicer_TCLSH ${CMAKE_BINARY_DIR}/tcl-build/bin/tclsh84)
endif()
set(VTK_TCL_ARGS
-DTCL_INCLUDE_PATH:PATH=${CMAKE_BINARY_DIR}/tcl-build/include
-DTK_INCLUDE_PATH:PATH=${CMAKE_BINARY_DIR}/tcl-build/include
-DTCL_LIBRARY:FILEPATH=${slicer_TCL_LIB}
-DTK_LIBRARY:FILEPATH=${slicer_TK_LIB}
-DTCL_TCLSH:FILEPATH=${slicer_TCLSH}
)
endif()
ExternalProject_Add(${proj}
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
BINARY_DIR ${proj}-build
GIT_REPOSITORY "git://github.com/pieper/SlicerVTK.git"
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_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DVTK_USE_PARALLEL:BOOL=ON
-DVTK_DEBUG_LEAKS:BOOL=${Slicer3_USE_VTK_DEBUG_LEAKS}
-DVTK_WRAP_TCL:BOOL=${VTK_WRAP_TCL}
-DVTK_USE_RPATH:BOOL=ON
${VTK_TCL_ARGS}
-DVTK_WRAP_PYTHON:BOOL=${VTK_WRAP_PYTHON}
${VTK_PYTHON_ARGS}
${VTK_QT_ARGS}
${VTK_MAC_ARGS}
INSTALL_COMMAND ""
DEPENDS ${VTK_DEPENDENCIES}
)
set(VTK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
set(VTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj})
endif()
......@@ -4,18 +4,15 @@
set(proj teem)
set(zlib "vtkzlib.lib")
set(png "vtkpng.lib")
if(WIN32)
set(teem_ZLIB_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/${CMAKE_CFG_INTDIR}/vtkzlib.lib)
set(teem_PNG_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/${CMAKE_CFG_INTDIR}/vtkpng.lib)
set(teem_ZLIB_LIBRARY ${VTK_DIR}/bin/${CMAKE_CFG_INTDIR}/vtkzlib.lib)
set(teem_PNG_LIBRARY ${VTK_DIR}/bin/${CMAKE_CFG_INTDIR}/vtkpng.lib)
elseif(APPLE)
set(teem_ZLIB_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/libvtkzlib.dylib)
set(teem_PNG_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/libvtkpng.dylib)
set(teem_ZLIB_LIBRARY ${VTK_DIR}/bin/libvtkzlib.dylib)
set(teem_PNG_LIBRARY ${VTK_DIR}/bin/libvtkpng.dylib)
else()
set(teem_ZLIB_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/libvtkzlib.so)
set(teem_PNG_LIBRARY ${CMAKE_BINARY_DIR}/VTK-build/bin/libvtkpng.so)
set(teem_ZLIB_LIBRARY ${VTK_DIR}/bin/libvtkzlib.so)
set(teem_PNG_LIBRARY ${VTK_DIR}/bin/libvtkpng.so)
endif()
ExternalProject_Add(${proj}
......@@ -37,13 +34,13 @@ ExternalProject_Add(${proj}
-DTeem_ZLIB:BOOL=ON
-DTeem_PNG:BOOL=ON
-DTeem_VTK_MANGLE:BOOL=ON
-DTeem_VTK_TOOLKITS_IPATH:FILEPATH=${CMAKE_BINARY_DIR}/VTK-build
-DZLIB_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/VTK/Utilities
-DTeem_VTK_ZLIB_MANGLE_IPATH:PATH=${CMAKE_BINARY_DIR}/VTK/Utilities/vtkzlib
-DTeem_ZLIB_DLLCONF_IPATH:PATH=${CMAKE_BINARY_DIR}/VTK-build/Utilities
-DTeem_VTK_TOOLKITS_IPATH:FILEPATH=${VTK_DIR}
-DZLIB_INCLUDE_DIR:PATH=${VTK_SOURCE_DIR}/Utilities
-DTeem_VTK_ZLIB_MANGLE_IPATH:PATH=${VTK_SOURCE_DIR}/Utilities/vtkzlib
-DTeem_ZLIB_DLLCONF_IPATH:PATH=${VTK_DIR}/Utilities
-DZLIB_LIBRARY:FILEPATH=${teem_ZLIB_LIBRARY}
-DPNG_PNG_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/VTK/Utilities/vtkpng
-DTeem_PNG_DLLCONF_IPATH:PATH=${CMAKE_BINARY_DIR}/VTK-build/Utilities
-DPNG_PNG_INCLUDE_DIR:PATH=${VTK_SOURCE_DIR}/Utilities/vtkpng
-DTeem_PNG_DLLCONF_IPATH:PATH=${VTK_DIR}/Utilities
-DPNG_LIBRARY:FILEPATH=${teem_PNG_LIBRARY}
-DTeem_USE_LIB_INSTALL_SUBDIR:BOOL=ON
INSTALL_COMMAND ""
......
message("Configuring numpy:\n@numpy_binary@")
message("Configuring NUMPY:\n@NUMPY_binary@")
set(ENV{LD_LIBRARY_PATH} "@CMAKE_CURRENT_BINARY_DIR@/python-build/lib")
# setup the site.cfg file
file(WRITE "@numpy_binary@/site.cfg"
file(WRITE "@NUMPY_binary@/site.cfg"
"
[blas]
library_dirs = @clapack_binary@/BLAS/SRC;@clapack_binary@/CLAPACK-build/F2CLIBS/libf2c
library_dirs = @CLAPACK_binary@/BLAS/SRC;@CLAPACK_binary@/CLAPACK-build/F2CLIBS/libf2c
libraries = blas,libf2c
[lapack]
library_dirs = @clapack_binary@/SRC/
library_dirs = @CLAPACK_binary@/SRC/
lapack_libs = lapack
")
execute_process(
COMMAND "@slicer_PYTHON_EXECUTABLE@" setup.py config
WORKING_DIRECTORY "@numpy_binary@"
WORKING_DIRECTORY "@NUMPY_binary@"
RESULT_VARIABLE res)
if(NOT ${res} EQUAL 0)
message(FATAL_ERROR "Error in config of numpy")
message(FATAL_ERROR "Error in config of NUMPY")
endif()
message("Numpy config worked.")
message("Building numpy:\n@numpy_binary@")
message("Building NUMPY:\n@NUMPY_binary@")
set(ENV{LD_LIBRARY_PATH} "@CMAKE_CURRENT_BINARY_DIR@/python-build/lib")
execute_process(
COMMAND "@slicer_PYTHON_EXECUTABLE@" setup.py install
WORKING_DIRECTORY "@numpy_binary@"
WORKING_DIRECTORY "@NUMPY_binary@"