Commit 5c83220a authored by jcfr's avatar jcfr
Browse files

ENH: Added option Slicer_USE_CTKAPPLAUNCHER allowing to test CTKAppLauncher

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15068 3bd1e089-480b-0410-8dfb-8563597acbee
parent 3a06569b
################################################################################
#
# 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 Jean-Christophe Fillion-Robin, Kitware Inc.
# and was partially funded by NIH grant 3P41RR013218-12S1
#
################################################################################
# Build type
SET(CTKAPPLAUNCHER_BUILD_TYPE)
IF(WIN32)
SET(CTKAPPLAUNCHER_BUILD_TYPE ${CMAKE_BUILD_TYPE})
ENDIF()
#-----------------------------------------------------------------------------
# Settings specific to the build tree.
#
#
# LIBRARY_PATHS
#
SET(SLICER_LIBRARY_PATHS_BUILD
${VTK_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
${CTK_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
${CTK_DIR}/CMakeExternals/Build/PythonQt/${CTKAPPLAUNCHER_BUILD_TYPE}
${QT_LIBRARY_DIR}
${ITK_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
${Teem_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
./bin/${CTKAPPLAUNCHER_BUILD_TYPE}
./${Slicer3_INSTALL_PLUGINS_LIB_DIR}/${CTKAPPLAUNCHER_BUILD_TYPE}
./${Slicer3_INSTALL_QTLOADABLEMODULES_LIB_DIR}/${CTKAPPLAUNCHER_BUILD_TYPE}
)
IF(Slicer3_USE_PYTHONQT_WITH_TCL)
LIST(APPEND SLICER_LIBRARY_PATHS_BUILD
${Slicer3_TCL_DIR}/lib
)
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
LIST(APPEND SLICER_LIBRARY_PATHS_BUILD
${Slicer3_TCL_DIR}/lib/itcl${INCR_TCL_VERSION_DOT}
${Slicer3_TCL_DIR}/lib/itk${INCR_TCL_VERSION_DOT}
)
ENDIF()
ENDIF()
IF(Slicer3_USE_BatchMake)
LIST(APPEND SLICER_LIBRARY_PATHS_BUILD
${BatchMake_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
)
ENDIF()
IF(Slicer3_USE_OPENIGTLINK)
LIST(APPEND SLICER_LIBRARY_PATHS_BUILD
${OpenIGTLink_DIR}
${OpenIGTLink_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
)
ENDIF()
IF(Slicer3_USE_PYTHONQT)
get_filename_component(SLICER_PYTHON_LIB_DIR ${PYTHON_LIBRARY} PATH)
LIST(APPEND SLICER_LIBRARY_PATHS_BUILD ${SLICER_PYTHON_LIB_DIR})
ENDIF()
#
# PATHS
#
SET(SLICER_PATHS_BUILD
./bin/${CTKAPPLAUNCHER_BUILD_TYPE}
./${Slicer3_INSTALL_PLUGINS_LIB_DIR}/${CTKAPPLAUNCHER_BUILD_TYPE}
./${Slicer3_INSTALL_QTLOADABLEMODULES_LIB_DIR}/${CTKAPPLAUNCHER_BUILD_TYPE}
${Teem_DIR}/bin/${CTKAPPLAUNCHER_BUILD_TYPE}
${QT_BINARY_DIR}
)
IF(Slicer3_USE_PYTHONQT_WITH_TCL)
LIST(APPEND SLICER_PATHS_BUILD
${Slicer3_TCL_DIR}/bin
)
ENDIF()
#
# ENVVARS
#
SET(SLICER_ENVVARS_BUILD
"QT_PLUGIN_PATH=./bin<PATHSEP>${CTK_DIR}/CTK-build/bin"
)
IF(Slicer3_USE_PYTHONQT)
SET(pythonpath_subdir python2.6)
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
SET(pythonpath_subdir "../Lib")
ENDIF()
SET(PYTHONPATH "${SLICER_PYTHON_LIB_DIR}")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP>${SLICER_PYTHON_LIB_DIR}/${pythonpath_subdir}/lib-tk")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP>${SLICER_PYTHON_LIB_DIR}/${pythonpath_subdir}/site-packages")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP>${SLICER_PYTHON_LIB_DIR}/${pythonpath_subdir}/site-packages/numpy")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP>${SLICER_PYTHON_LIB_DIR}/${pythonpath_subdir}/site-packages/numpy/lib")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP>${SLICER_PYTHON_LIB_DIR}/${pythonpath_subdir}/site-packages/numpy/core")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/bin")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/bin/python")
LIST(APPEND SLICER_ENVVARS_BUILD "PYTHONPATH=${PYTHONPATH}")
ENDIF()
IF(Slicer3_USE_PYTHONQT_WITH_TCL)
# Search locations for TCL packages - space separated list
SET(TCLLIBPATH "${Slicer3_TCL_DIR}/lib/itcl${INCR_TCL_VERSION_DOT}")
SET(TCLLIBPATH "${TCLLIBPATH} ${Slicer3_TCL_DIR}/lib/itk${INCR_TCL_VERSION_DOT}")
LIST(APPEND SLICER_ENVVARS_BUILD
"TCL_LIBRARY=${Slicer3_TCL_DIR}/lib/tcl${TCL_TK_VERSION_DOT}"
"TK_LIBRARY=${Slicer3_TCL_DIR}/lib/tk${TCL_TK_VERSION_DOT}"
"TCLLIBPATH=${TCLLIBPATH}"
)
ENDIF()
#-----------------------------------------------------------------------------
# Settings specific to the install tree.
#
#
# LIBRARY_PATHS
#
SET(SLICER_LIBRARY_PATHS_INSTALLED
./${Slicer3_INSTALL_BIN_DIR}
./${Slicer3_INSTALL_LIB_DIR}
./${Slicer3_INSTALL_PLUGINS_LIB_DIR}
./${Slicer3_INSTALL_QTLOADABLEMODULES_LIB_DIR}
# Slicer Libs
./lib/FreeSurfer
./lib/ITKCommandIO
./lib/LoadableModule
./lib/MGHImageIO
./lib/MRML
./lib/MRMLCLI
./lib/MRMLLogic
./lib/MRMLDisplayableManager
./lib/ModuleDescriptionParser
./lib/MRMLIDImageIO
./lib/Qdec
./lib/RemoteIO
./lib/FileWatcher
./lib/SlicerIO
./lib/tclap
./lib/vtkITK
./lib/vtkTeem
./lib/qMRMLWidgets
# External projects
./lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
./lib/Teem-${Teem_VERSION_MAJOR}.${Teem_VERSION_MINOR}.${Teem_VERSION_PATCH}
./lib/InsightToolkit
./lib/Qt
./lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}
)
IF(Slicer3_USE_OPENIGTLINK)
LIST(APPEND SLICER_LIBRARY_PATHS_INSTALLED
# Slicer Libs
./lib/IGT
# External projects
./lib/igtl
)
ENDIF()
IF(Slicer3_USE_BatchMake)
LIST(APPEND SLICER_LIBRARY_PATHS_INSTALLED
./lib/BatchMake
./lib/bmModuleDescriptionParser
)
ENDIF()
IF(Slicer3_USE_PYTHONQT)
SET(python_subdir "/lib")
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
SET(python_subdir "/PCbuild")
ENDIF()
LIST(APPEND SLICER_LIBRARY_PATHS_INSTALLED
./lib/Python${python_subdir}
./lib/PythonQt
)
ENDIF()
IF(Slicer3_USE_PYTHONQT_WITH_TCL)
LIST(APPEND SLICER_LIBRARY_PATHS_INSTALLED
./lib/TclTk/lib
./lib/TclTk/lib/itcl${INCR_TCL_VERSION_DOT}
./lib/TclTk/lib/itk${INCR_TCL_VERSION_DOT}
)
ENDIF()
#
# PATHS
#
SET(SLICER_PATHS_INSTALLED
./${Slicer3_INSTALL_BIN_DIR}
./${Slicer3_INSTALL_PLUGINS_BIN_DIR}
./${Slicer3_INSTALL_QTLOADABLEMODULES_BIN_DIR}
)
#
# ENVVARS
#
SET(SLICER_ENVVARS_INSTALLED
"QT_PLUGIN_PATH=<APPLAUNCHER_DIR>/${Slicer3_INSTALL_LIB_DIR}<PATHSEP><APPLAUNCHER_DIR>/lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}"
)
IF(Slicer3_USE_PYTHONQT)
SET(pythonpath_subdir python2.6)
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
SET(pythonpath_subdir "")
ENDIF()
SET(PYTHONPATH "${SLICER_PYTHON_LIB_DIR}")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/Python/${pythonpath_subdir}/lib-tk")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/Python/${pythonpath_subdir}/site-packages")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/Python/${pythonpath_subdir}/site-packages/numpy")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/Python/${pythonpath_subdir}/site-packages/numpy/lib")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/Python/${pythonpath_subdir}/site-packages/numpy/core")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/FreeSurfer")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/MRML")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/MRMLLogic")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/RemoteIO")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/lib/vtkTeem")
SET(PYTHONPATH "${PYTHONPATH}<PATHSEP><APPLAUNCHER_DIR>/bin/Python")
LIST(APPEND SLICER_ENVVARS_INSTALLED "PYTHONPATH=${PYTHONPATH}")
ENDIF()
IF(Slicer3_USE_PYTHONQT_WITH_TCL)
# Search locations for TCL packages - space separated list
SET(TCLLIBPATH "<APPLAUNCHER_DIR>/lib/TclTk/lib/itcl${INCR_TCL_VERSION_DOT}")
SET(TCLLIBPATH "${TCLLIBPATH} <APPLAUNCHER_DIR>/lib/TclTk/lib/itk${INCR_TCL_VERSION_DOT}")
LIST(APPEND SLICER_ENVVARS_INSTALLED
"TCL_LIBRARY=<APPLAUNCHER_DIR>/lib/TclTk/lib/tcl${TCL_TK_VERSION_DOT}"
"TK_LIBRARY=<APPLAUNCHER_DIR>/lib/TclTk/lib/tk${TCL_TK_VERSION_DOT}"
"TCLLIBPATH=${TCLLIBPATH}"
)
ENDIF()
......@@ -758,6 +758,43 @@ IF(Slicer3_USE_QT)
ENDIF()
ENDFOREACH(qtlib)
ENDIF(APPLE)
option(Slicer_USE_CTKAPPLAUNCHER "Configure ctkAppLauncher." OFF)
mark_as_advanced(Slicer_USE_CTKAPPLAUNCHER)
# ctkAppLauncher for slicer
IF(Slicer_USE_CTKAPPLAUNCHER)
INCLUDE(${CTKAPPLAUNCHER_DIR}/CMake/ctkAppLauncher.cmake)
INCLUDE(${Slicer3_CMAKE_DIR}/SlicerCTKAppLauncherSettings.cmake)
ctkAppLauncherConfigure(
APPLICATION_PATH ${Slicer3_BINARY_DIR}/bin/SlicerQT-real${CMAKE_EXECUTABLE_SUFFIX}
APPLICATION_INSTALL_SUBDIR ${Slicer3_INSTALL_BIN_DIR}
APPLICATION_NAME Slicer
SPLASH_IMAGE_PATH ${Slicer3_SOURCE_DIR}/Applications/SlicerQT/Resources/Images/SlicerSplashScreen.png
SPLASH_IMAGE_INSTALL_SUBDIR ${Slicer3_INSTALL_BIN_DIR}
SPLASHSCREEN_HIDE_DELAY_MS 3000
ADDITIONAL_HELP_SHORT_ARG "-h"
ADDITIONAL_HELP_LONG_ARG "--help"
ADDITIONAL_NOSPLASH_LONG_ARG "--no-splash"
DESTINATION_DIR ${Slicer3_BINARY_DIR}
LIBRARY_PATHS_BUILD "${SLICER_LIBRARY_PATHS_BUILD}"
PATHS_BUILD "${SLICER_PATHS_BUILD}"
ENVVARS_BUILD "${SLICER_ENVVARS_BUILD}"
LIBRARY_PATHS_INSTALLED "${SLICER_LIBRARY_PATHS_INSTALLED}"
PATHS_INSTALLED "${SLICER_PATHS_INSTALLED}"
ENVVARS_INSTALLED "${SLICER_ENVVARS_INSTALLED}"
)
install(PROGRAMS "${Slicer3_BINARY_DIR}/Slicer${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ".")
install(
FILES "${Slicer3_SOURCE_DIR}/Applications/SlicerQT/Resources/Images/SlicerSplashScreen.png"
DESTINATION ${Slicer3_INSTALL_BIN_DIR}
)
install(
FILES "${Slicer3_BINARY_DIR}/SlicerLauncherSettingsToInstall.ini"
DESTINATION ${Slicer3_INSTALL_BIN_DIR}
RENAME SlicerLauncherSettings.ini
)
ENDIF()
ENDIF(Slicer3_USE_QT)
......
......@@ -244,6 +244,9 @@ if(Slicer3_USE_QT)
option(Slicer3_USE_PYTHONQT "Integrate a PythonQt interpreter into Slicer." ON)
option(Slicer3_USE_PYTHONQT_WITH_TCL "Enable PythonQt Tcl adapter layer" ON)
option(Slicer_USE_CTKAPPLAUNCHER "Configure ctkAppLauncher." OFF)
mark_as_advanced(Slicer_USE_CTKAPPLAUNCHER)
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")
......@@ -346,6 +349,7 @@ set(scipy_DEPENDENCIES NUMPY)
set(weave_DEPENDENCIES python NUMPY)
set(VTK_DEPENDENCIES)
set(CTKAPPLAUNCHER_DEPENDENCIES)
set(CTK_DEPENDENCIES VTK)
if(Slicer3_USE_PYTHONQT)
list(APPEND CTK_DEPENDENCIES python)
......@@ -388,6 +392,9 @@ include(External_VTK)
if(Slicer3_USE_QT)
include(External_CTK)
if (Slicer_USE_CTKAPPLAUNCHER)
include(External_CTKAPPLAUNCHER)
endif()
endif()
if(Slicer3_USE_KWWIDGETS)
......@@ -421,6 +428,9 @@ endif()
if(Slicer3_USE_QT)
list(APPEND slicer_DEPENDENCIES CTK)
if (Slicer_USE_CTKAPPLAUNCHER)
list(APPEND slicer_DEPENDENCIES CTKAPPLAUNCHER)
endif()
endif()
if(Slicer3_USE_PYTHON OR Slicer3_USE_PYTHONQT)
......@@ -503,6 +513,8 @@ ExternalProject_Add(${proj}
-DSlicer3_USE_QT:BOOL=${Slicer3_USE_QT}
-DQT_QMAKE_EXECUTABLE:PATH=${QT_QMAKE_EXECUTABLE}
-DCTK_DIR:PATH=${CTK_DIR}
-DSlicer_USE_CTKAPPLAUNCHER:BOOL=${Slicer_USE_CTKAPPLAUNCHER}
-DCTKAPPLAUNCHER_DIR:PATH=${CTKAPPLAUNCHER_DIR}
# KWWidgets
-DSlicer3_USE_KWWIDGETS:BOOL=${Slicer3_USE_KWWIDGETS}
-DKWWidgets_DIR:PATH=${CMAKE_BINARY_DIR}/KWWidgets-build
......
#
# CTKAPPLAUNCHER
#
IF(Slicer_USE_CTKAPPLAUNCHER)
# Sanity checks
IF(DEFINED CTKAPPLAUNCHER_DIR AND NOT EXISTS ${CTKAPPLAUNCHER_DIR})
MESSAGE(FATAL_ERROR "CTKAPPLAUNCHER_DIR variable is defined but corresponds to non-existing directory")
ENDIF()
set(proj CTKAPPLAUNCHER)
IF(NOT DEFINED CTKAPPLAUNCHER_DIR)
SET(launcher_suffix)
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux"
#OR CMAKE_SYSTEM_NAME STREQUAL "Windows"
#OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"
#OR CMAKE_SYSTEM_NAME STREQUAL "Solaris"
)
SET(launcher_suffix ${CMAKE_SYSTEM_NAME})
ELSE()
MESSAGE(FATAL_ERROR "Failed to download pre-built launcher - Unsupported platform: ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
ENDIF()
SET(launcher_version "0.1.0")
ExternalProject_Add(${proj}
#URL /home/jchris/Projects/CTK-AppLauncher-Release/CTKAppLauncher-${launcher_version}-${launcher_suffix}.tar.gz
URL http://github.com/downloads/commontk/AppLauncher/CTKAppLauncher-${launcher_version}-${launcher_suffix}.tar.gz
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${CTKAPPLAUNCHER_DEPENDENCIES}
)
SET(CTKAPPLAUNCHER_DIR ${CMAKE_BINARY_DIR}/${proj})
ENDIF()
ENDIF()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment