Commit 594f9326 authored by jcfr's avatar jcfr

ENH: Simplify and optimize superbuild

External project specification have been added to SuperBuild.cmake

Running:
  1) "cmake ../Slicer4" => Build using SuperBuild
  2) "cmake -DSlicer_SUPERBUILD:BOOL=OFF ../Slicer4" => Build without Superbuild

In case (2), all external dependencies (VTK, ITK, ...) will have
to be specified manually.

Layout of the CMakeLists.txt has been reviewed to improve readability

Factored out cmake code and use macro SlicerMacroEmptyExternalProject
in VTK, ITK and CTK external project description.

${ep_common_args} has been introduced to contain option common
to all external project.

launcher.tcl.in has been updated to properly behave when KWWidgets_*_DIR
are not specified.

CTestCustom files has been merged into one file now located
in CMake subdirectory

SlicerFindQt.cmake has been removed, Qt discovery is now handled
directly in both CMakeLists.txt and SuperBuild.cmake

{Subversion_SVN, GIT}_EXECUTABLE are now discovered at superbuild
configure time. In case of error a message will be immediately thrown
in case of problem.

Dashboard template and driver script have been updated to reflect new
directory layout.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15174 3bd1e089-480b-0410-8dfb-8563597acbee
parent a1a4d243
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 10000)
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 10000)
#
# For further details regarding this file,
# see http://www.vtk.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
#
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude try_compile sources from coverage results:
"/CMakeFiles/CMakeTmp/"
# Exclude files generated by the moc pre-compiler
".*/moc_.*"
# Exclude files generated by the uic pre-compiler
".*/ui_.*"
# Exclude files from the Testing directories
".*/Testing/.*"
)
# The following tests should not be run under valgrind
SET(CTEST_CUSTOM_MEMCHECK_IGNORE
)
SET(CTEST_CUSTOM_ERROR_MATCH
${CTEST_CUSTOM_ERROR_MATCH}
......@@ -11,6 +36,9 @@ SET(CTEST_CUSTOM_WARNING_MATCH
"CMake Warning[ :]"
)
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 10000)
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 10000)
SET(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
#"vtkparse.tab.c"
......@@ -44,7 +72,6 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# warning: '...' is deprecated (declared at ...)
"tcl.tcl.unix.*warning:.*is deprecated"
# Tk
"tcl.tk.unix.*warning: cast"
"System.Library.Frameworks.Tk.framework.Headers.X11.Xlib.h.*warning: function declaration isn't a prototype"
......@@ -139,11 +166,10 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"(KWW|kww)idgets.[Uu]tilities.tkdnd"
"(KWW|kww)idgets.vtk(KW|kw)"
# Libs/OpenIGTLink
"(OpenIGTLink|openigtlink).[Ss]ource.igtl"
#Batchmake
# Batchmake
"BatchMake.Utilities.Zip.(zip|unzipcmd|zipcmd).*warning"
# Libs/tclap
......@@ -202,9 +228,6 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# Since NUMPY has test that return build errors, let's add the following exception
"WARNING non-zero return value in ctest from"
#Weave
"UserWarning: 'licence' distribution option is deprecated; use 'license'"
)
SET(CTEST_CUSTOM_ERROR_EXCEPTION
......
......@@ -80,14 +80,14 @@ endif()
set(CTEST_UPDATE_COMMAND "${CTEST_SVN_COMMAND}")
set(CTEST_SOURCE_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/SuperBuild")
set(CTEST_SOURCE_DIRECTORY "${CTEST_SOURCE_DIRECTORY}")
#
# run_ctest macro
#
MACRO(run_ctest)
ctest_start(${model})
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}/.." RETURN_VALUE res)
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
# force a build if this is the first run and the build dir is empty
if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
......@@ -98,6 +98,7 @@ MACRO(run_ctest)
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
QT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
Subversion_SVN_EXECUTABLE:FILEPATH=${CTEST_SVN_COMMAND}
WITH_COVERAGE:BOOL=${WITH_COVERAGE}
DOCUMENTATION_TARGET_IN_ALL:BOOL=${WITH_DOCUMENTATION}
DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY:PATH=${DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY}
......
#
# Check if VTK was configured with QT,
# if so, use it,
# otherwise, complain.
#
OPTION(Slicer_USE_QT "Use Qt as an extra GUI library" OFF)
MACRO(SLICER_SETUP_QT)
IF(Slicer_USE_QT)
SET(minimum_required_qt_version "4.6.2")
IF(VTK_USE_QVTK)
# Check if QT_QMAKE_EXECUTABLE is set
IF(NOT VTK_QT_QMAKE_EXECUTABLE)
MESSAGE(FATAL_ERROR "error: There is a problem with your configuration, the variable VTK_QT_QMAKE_EXECUTABLE should be exposed by VTK.")
ENDIF()
SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE})
FIND_PACKAGE(Qt4)
MESSAGE(STATUS "Configuring Slicer with Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
IF(QT4_FOUND AND QT_QMAKE_EXECUTABLE)
# Check version, note that ${QT_VERSION_PATCH} could also be used
IF("${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}" VERSION_LESS "${minimum_required_qt_version}")
MESSAGE(FATAL_ERROR "error: Slicer requires Qt >= ${minimum_required_qt_version} -- you cannot use Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}. You should probably reconfigure VTK.")
ENDIF()
# Enable modules
SET(QT_USE_QTNETWORK ON)
SET(QT_USE_QTTEST ${BUILD_TESTING})
# Includes Qt headers
INCLUDE(${QT_USE_FILE})
ELSE()
MESSAGE(FATAL_ERROR "error: Qt >= ${minimum_required_qt_version} was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable.")
ENDIF()
ELSE()
MESSAGE("error: VTK was not configured to use QT, you probably need to recompile it with VTK_USE_GUISUPPORT ON, VTK_USE_QVTK ON, DESIRED_QT_VERSION 4 and QT_QMAKE_EXECUTABLE set appropriatly. Note that Qt >= ${minimum_required_qt_version} is *required*")
ENDIF()
ENDIF()
ENDMACRO()
###########################################################################
#
# Library: CTK
#
# Copyright (c) Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.commontk.org/LICENSE
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
# See http://github.com/commontk/CTK/blob/master/CMake/ctkMacroEmptyExternalProject.cmake
#
# Convenient macro allowing to define a "empty" project in case an external one is provided
# using for example <proj>_DIR.
# Doing so allows to keep the external project dependency system happy.
#
MACRO(SlicerMacroEmptyExternalProject proj dependencies)
ExternalProject_Add(${proj}
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
BINARY_DIR ${proj}-build
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${dependencies}
)
ENDMACRO()
This diff is collapsed.
#
# For further details regarding this file,
# see http://www.vtk.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
#
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 50)
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude kwsys files from coverage results. They are reported
# (with better coverage results) on kwsys dashboards...
"/Source/(cm|kw)sys/"
# Exclude try_compile sources from coverage results:
"/CMakeFiles/CMakeTmp/"
# Exclude files generated by Tcl wrapping
".*Tcl.cxx"
# Exclude files generated by the moc pre-compiler
"moc_.*"
# Exclude files from the Testing directories
".*/Testing/.*"
# Exclude files that manage GUI
".*GUI.cxx"
".*Widgets.cxx"
"vtkKW.*"
"vtkSlicerApplication.h"
"vtkSlicerApplication.cxx"
"vtkSlicerApplicationSettingsInterface.h"
"vtkSlicerApplicationSettingsInterface.h"
# Exclude Qt source files from coverage results:
"[A-Za-z]./[Qq]t/qt-.+-opensource-src"
)
SET(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
# Suppressing warnings about GL_GLEXT_LEGACY, the link reported below
# report a similar problem with GL_GLEXT_PROTOTYPE.
# http://lists.apple.com/archives/mac-opengl/2009/Dec/msg00081.html
# That problem could be solved installing a newer version of X11 SDK
# See http://xquartz.macosforge.org/trac/changeset/343
".*warning.*GL_GLEXT_LEGACY.*redefined"
# ITK suppressions
"[Uu]tilities.gdcm"
"[Uu]tilities.vxl"
"[Uu]tilities.itktiff"
"[Ii]nsight.[Cc]ode.[Cc]ommon"
"[Ii]nsight.[Cc]ode.[Nn]umerics"
"[Ii]nsight.[Cc]ode.(IO|io)"
# VTK suppressions
"vtkfreetype"
"Utilities.vtktiff"
"VTK.*IO.vtkMySQLQuery.cxx"
"VTK.*Utilities.vtkexodus2"
"VTK.*Utilities.vtklibproj"
"VTK.*Utilities.vtksqlite"
"VTK.*Utilities.VPIC.*cxx"
"VTK.*warn_unused_result"
"VTK.*Filtering.*cxx"
"VTK.*IO.*cxx"
"VTK.*Infovis.*cxx"
# exception specific to Mac/Carbon
"VTK.Rendering.vtkCarbonRenderWindow.*warning.*(NewRgn|DiffRgn|EqualRgn|DisposeRgn).*is deprecated"
# exception specific to Mac/X11
"VTK.Rendering.vtkOpenGL.*warning: this is the location of the previous definition"
# qt suppressions from vtk...
# Some VTK dashboards include building bits of Qt which produce lots of
# the following warnings when built with the MS compilers. Qt guys should
# fix their code. Until they do, keep the Qt chatter off the VTK dashboard
# results:
"include.[Qq]t([Cc]ore|[Gg]ui).*warning C4127: conditional expression is constant"
"[Qq]t.*h.*warning.*declaration of .* shadows a member of .this"
"[Qq]t.*h.*warning.*(copy constructor|assignment operator) could not be generated"
# Suppress warning caused when QT 'foreach' loops are combined
"warning: declaration of '_container_' shadows a previous local"
# Libs/tclap
"tclap.include.tclap.*Arg.h.*warning C4512"
# Python suppressions
# About redefinition of symbols
"pyconfig.h.*warning:.*redefined"
"features.h.*"
# curl suppressions
"cmcurl.*warning.*conditional expression is constant"
"cmcurl.(transfer|ftp|file|cookie).c.*warning C4244.*possible loss of data"
# Suppressing warnings about duplicate libraries in Darwin
# At some point this may be addressed by CMake feature request:
# http://public.kitware.com/Bug/view.php?id=10179
"ld: warning: duplicate dylib"
# Libs/OpenIGTLink
"(OpenIGTLink|openigtlink).[Ss]ource.igtl"
# Visual studio spurious warnings...
"The following environment variables were not found"
)
################################################################################
#
# Program: 3D Slicer
#
# Copyright (c) 2010 Kitware Inc.
#
# See Doc/copyright/copyright.txt
# or http://www.slicer.org/copyright/copyright.txt for details.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file was originally developed by
# Dave Partyka and Jean-Christophe Fillion-Robin, Kitware Inc.
# and was partially funded by NIH grant 3P41RR013218-12S1
#
################################################################################
#-----------------------------------------------------------------------------
# Git protocole option
#-----------------------------------------------------------------------------
option(Slicer_USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON)
set(git_protocol "git")
if(NOT Slicer_USE_GIT_PROTOCOL)
set(git_protocol "http")
endif()
#-----------------------------------------------------------------------------
# Qt - Let's check if a valid version of Qt is available
#-----------------------------------------------------------------------------
FIND_PACKAGE(Qt4)
IF(QT_FOUND)
IF("${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}" VERSION_LESS "${minimum_required_qt_version}")
MESSAGE(FATAL_ERROR "error: Slicer requires Qt >= ${minimum_required_qt_version} -- you cannot use Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}.")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "error: Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
ENDIF()
#-----------------------------------------------------------------------------
# Enable and setup External project global properties
#-----------------------------------------------------------------------------
INCLUDE(ExternalProject)
set(ep_base "${CMAKE_BINARY_DIR}")
#set(ep_install_dir "${ep_base}/Install")
SET(ep_common_args
#-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
)
# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
set(gen "${CMAKE_GENERATOR}")
endif()
#------------------------------------------------------------------------------
# Establish Target Dependencies based on Selected Options
#------------------------------------------------------------------------------
set(tcl_DEPENDENCIES)
set(tk_DEPENDENCIES tcl)
set(incrTcl_DEPENDENCIES tcl tk)
set(iwidgets_DEPENDENCIES tcl itcl)
set(blt_DEPENDENCIES tcl tk)
set(python_DEPENDENCIES)
if(Slicer_USE_KWWIDGETS OR Slicer_USE_PYTHONQT_WITH_TCL)
if(WIN32)
set(python_DEPENDENCIES tcl)
else()
set(python_DEPENDENCIES tk)
endif()
endif()
set(CLAPACK_DEPENDENCIES)
set(NUMPY_DEPENDENCIES CLAPACK python)
set(scipy_DEPENDENCIES NUMPY)
set(weave_DEPENDENCIES python NUMPY)
set(VTK_DEPENDENCIES)
set(CTKAPPLAUNCHER_DEPENDENCIES)
set(CTK_DEPENDENCIES VTK)
if(Slicer_USE_PYTHONQT)
list(APPEND CTK_DEPENDENCIES python)
endif()
set(KWWidgets_DEPENDENCIES VTK)
set(Insight_DEPENDENCIES)
set(BatchMake_DEPENDENCIES Insight)
set(OpenIGTLink_DEPENDENCIES)
set(teem_DEPENDENCIES VTK)
set(cmcurl_DEPENDENCIES)
set(slicer_DEPENDENCIES VTK Insight BatchMake OpenIGTLink teem cmcurl)
#------------------------------------------------------------------------------
# Conditionnaly include ExternalProject Target
#------------------------------------------------------------------------------
if(Slicer_USE_KWWIDGETS OR Slicer_USE_PYTHONQT_WITH_TCL)
include(SuperBuild/External_Tcl.cmake)
include(SuperBuild/External_Tk.cmake)
include(SuperBuild/External_incrTcl.cmake)
endif()
if(Slicer_USE_KWWIDGETS)
include(SuperBuild/External_iwidgets.cmake)
include(SuperBuild/External_blt.cmake)
endif()
if(Slicer_USE_PYTHON OR Slicer_USE_PYTHONQT)
include(SuperBuild/External_Python26.cmake)
if(Slicer_BUILD_NUMPY)
include(SuperBuild/External_CLAPACK.cmake)
include(SuperBuild/External_NUMPY.cmake)
include(SuperBuild/External_weave.cmake)
if(Slicer_BUILD_SCIPY)
include(SuperBuild/External_SciPy.cmake)
endif()
endif()
endif()
include(SuperBuild/External_VTK.cmake)
if(Slicer_USE_QT)
include(SuperBuild/External_CTK.cmake)
if (Slicer_USE_CTKAPPLAUNCHER)
include(SuperBuild/External_CTKAPPLAUNCHER.cmake)
endif()
endif()
if(Slicer_USE_KWWIDGETS)
include(SuperBuild/External_KWWidgets.cmake)
endif()
include(SuperBuild/External_Insight.cmake)
include(SuperBuild/External_teem.cmake)
include(SuperBuild/External_OpenIGTLink.cmake)
include(SuperBuild/External_BatchMake.cmake)
include(SuperBuild/External_cmcurl.cmake)
#-----------------------------------------------------------------------------
# Update external project dependencies
#------------------------------------------------------------------------------
# For now, tk and itcl are used only when Slicer_USE_KWWIDGETS is ON
if(Slicer_USE_KWWIDGETS)
if(WIN32)
list(APPEND slicer_DEPENDENCIES tcl KWWidgets)
else()
list(APPEND slicer_DEPENDENCIES tcl tk blt iwidgets itcl KWWidgets)
endif()
endif()
if (Slicer_USE_PYTHONQT_WITH_TCL)
if(UNIX)
list(APPEND slicer_DEPENDENCIES itcl)
endif()
endif()
if(Slicer_USE_QT)
list(APPEND slicer_DEPENDENCIES CTK)
if (Slicer_USE_CTKAPPLAUNCHER)
list(APPEND slicer_DEPENDENCIES CTKAPPLAUNCHER)
endif()
endif()
if(Slicer_USE_PYTHON OR Slicer_USE_PYTHONQT)
list(APPEND slicer_DEPENDENCIES python)
if(Slicer_BUILD_NUMPY)
list(APPEND slicer_DEPENDENCIES NUMPY)
if(Slicer_BUILD_SCIPY)
list(APPEND slicer_DEPENDENCIES scipy)
endif()
endif()
endif()
#------------------------------------------------------------------------------
# List of external projects
#------------------------------------------------------------------------------
#set(external_project_list tk tcl incrTcl iwidgets blt python weave CLAPACK NUMPY scipy VTK CTK KWWidgets Insight BatchMake OpenIGTLink teem cmcurl slicer)
#-----------------------------------------------------------------------------
# Dump external project dependencies
#------------------------------------------------------------------------------
#set(ep_dependency_graph "# External project dependencies")
#foreach(ep ${external_project_list})
# set(ep_dependency_graph "${ep_dependency_graph}\n${ep}:${${ep}_DEPENDENCIES}")
#endforeach()
#file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ExternalProjectDependencies.txt "${ep_dependency_graph}\n")
#-----------------------------------------------------------------------------
# Set superbuild boolean args
#
SET(slicer_cmake_boolean_args
BUILD_DOCUMENTATION
BUILD_TESTING
BUILD_SHARED_LIBS
WITH_COVERAGE
WITH_MEMCHECK
Slicer_BUILD_CLI
Slicer_BUILD_QTLOADABLEMODULES
Slicer_USE_QT
Slicer_USE_PYTHONQT
Slicer_USE_PYTHONQT_WITH_TCL
Slicer_USE_CTKAPPLAUNCHER
Slicer_USE_BatchMake
Slicer_USE_MIDAS
Slicer_USE_OPENIGTLINK
Slicer_USE_OPENCV
Slicer_WITH_LIBRARY_VERSION
#Slicer_BUILD_NUMPY
# Deprecated
Slicer_USE_PYTHON
Slicer_USE_KWWIDGETS
Slicer_BUILD_MODULES
)
SET(slicer_superbuild_boolean_args)
FOREACH(slicer_cmake_arg ${slicer_cmake_boolean_args})
LIST(APPEND slicer_superbuild_boolean_args -D${slicer_cmake_arg}:BOOL=${${slicer_cmake_arg}})
ENDFOREACH()
# MESSAGE("CMake args:")
# FOREACH(arg ${slicer_superbuild_boolean_args})
# MESSAGE(" ${arg}")
# ENDFOREACH()
#-----------------------------------------------------------------------------
# Configure and build Slicer
#------------------------------------------------------------------------------
set(proj Slicer)
ExternalProject_Add(${proj}
DEPENDS ${slicer_DEPENDENCIES}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
BINARY_DIR Slicer-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
${slicer_superbuild_boolean_args}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DSubversion_SVN_EXECUTABLE:FILEPATH=${Subversion_SVN_EXECUTABLE}
-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
-DSlicer_SUPERBUILD:BOOL=OFF
# ITK
-DITK_DIR:PATH=${ITK_DIR}
# Teem
-DTeem_DIR:PATH=${Teem_DIR}
# OpenIGTLink
-DOpenIGTLink_DIR:PATH=${OpenIGTLink_DIR}
# BatchMake
-DBatchMake_DIR:PATH=${BatchMake_DIR}
# VTK
-DVTK_DIR:PATH=${VTK_DIR}
-DVTK_DEBUG_LEAKS:BOOL=${Slicer_USE_VTK_DEBUG_LEAKS}
# TCL/Tk
-DINCR_TCL_LIBRARY:FILEPATH=${slicer_TCL_LIB}
-DINCR_TK_LIBRARY:FILEPATH=${slicer_TK_LIB}
-DSlicer_TCL_DIR:PATH=${tcl_build}
# cmcurl
-DSLICERLIBCURL_DIR:PATH=${SLICERLIBCURL_DIR}
# Python
-DSlicer_USE_SYSTEM_PYTHON:BOOL=OFF
-DPYTHON_EXECUTABLE:FILEPATH=${slicer_PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${slicer_PYTHON_INCLUDE}
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
# Qt
-DQT_QMAKE_EXECUTABLE:PATH=${QT_QMAKE_EXECUTABLE}
# CTK
-DCTK_DIR:PATH=${CTK_DIR}
# CTKAppLauncher
-DCTKAPPLAUNCHER_DIR:PATH=${CTKAPPLAUNCHER_DIR}
# Deprecated - KWWidgets
-DKWWidgets_DIR:PATH=${KWWidgets_DIR}
INSTALL_COMMAND ""
)
......@@ -502,4 +502,4 @@ ExternalProject_Add(${proj}
-DSlicer_USE_KWWIDGETS:BOOL=${Slicer_USE_KWWIDGETS}
-DKWWidgets_DIR:PATH=${CMAKE_BINARY_DIR}/KWWidgets-build
INSTALL_COMMAND ""
)
)
#-----------------------------------------------------------------------------
# Get and build BatchMake
set(proj BatchMake)
ExternalProject_Add(${proj}
......@@ -11,15 +8,16 @@ ExternalProject_Add(${proj}
BINARY_DIR BatchMake-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
${ep_common_args}
-DBUILD_SHARED_LIBS:BOOL=ON
-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=${ITK_DIR}
-DITK_DIR:PATH=${ITK_DIR}
INSTALL_COMMAND ""
DEPENDS
${BatchMake_DEPENDENCIES}
)
set(BatchMake_DIR ${CMAKE_BINARY_DIR}/BatchMake-build)
......@@ -34,10 +34,10 @@ ExternalProject_Add(CLAPACK
URL ${CLAPACK_file}
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS_CLAPACK}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS_CLAPACK}
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ""
DEPENDS
${CLAPACK_DEPENDENCIES}
......
......@@ -17,11 +17,10 @@ if (Slicer_USE_QT)
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}
${ep_common_args}
#-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
#-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCTK_USE_GIT_PROTOCOL:BOOL=${Slicer_USE_GIT_PROTOCOL}
-DBUILD_TESTING:BOOL=OFF
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DVTK_DIR:PATH=${VTK_DIR}
-DPYTHON_LIBRARY:FILEPATH=${slicer_PYTHON_LIBRARY}
......@@ -46,15 +45,6 @@ if (Slicer_USE_QT)
else()
# The project is provided using CTK_DIR, nevertheless since other project may depend on CTK,
# let's add an 'empty' one
ExternalProject_Add(${proj}
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
BINARY_DIR ${proj}-build
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${CTK_DEPENDENCIES}
)
SlicerMacroEmptyExternalProject(${proj} "${CTK_DEPENDENCIES}")
endif()
endif()
......@@ -20,21 +20,17 @@ if(NOT DEFINED ITK_DIR)
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}
${ep_common_args}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DCMAKE_SKIP_RPATH:BOOL=ON
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-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 ""
DEPENDS
......@@ -45,14 +41,5 @@ if(NOT DEFINED ITK_DIR)
else()
# The project is provided using ITK_DIR, nevertheless since other project may depend on ITK,
# let's add an 'empty' one
ExternalProject_Add(${proj}
SOURCE_DIR ${proj}
BINARY_DIR ${proj}-build
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${Insight_DEPENDENCIES}
)
SlicerMacroEmptyExternalProject(${proj} "${Insight_DEPENDENCIES}")
endif()
......@@ -14,17 +14,18 @@ ExternalProject_Add(${proj}
BINARY_DIR KWWidgets-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
${ep_common_args}
-DKWWidgets_BUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DKWWidgets_BUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_SKIP_RPATH:BOOL=ON
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DVTK_DIR:PATH=${VTK_DIR}
-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 ""
DEPENDS
${KWWidgets_DEPENDENCIES}
)
set(KWWidgets_DIR ${CMAKE_BINARY_DIR}/KWWidgets-build)
......@@ -6,13 +6,13 @@ set(NUMPY_binary "${CMAKE_CURRENT_BINARY_DIR}/NUMPY/")
# the script will create a site.cfg file
# then run python setup.py config to verify setup
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/NUMPY_configure_step.cmake.in
SuperBuild/NUMPY_configure_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/NUMPY_configure_step.cmake @ONLY)
# to build numpy we also run a cmake -P script.
# the script will set LD_LIBRARY_PATH so that
# python can run after it is built on linux
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/NUMPY_make_step.cmake.in
SuperBuild/NUMPY_make_step.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/NUMPY_make_step.cmake @ONLY)
# create an external project to download numpy,
......
......@@ -10,14 +10,16 @@ ExternalProject_Add(${proj}