Commit 940ff43b authored by barre's avatar barre
Browse files

ENH: allow a module (Modules/GradientAnisotropicDiffusionFilter for now) to be...

ENH: allow a module (Modules/GradientAnisotropicDiffusionFilter for now) to be built in a standalone fashion against eithera Slicer3 build or Slicer3 installed. Update the config files accordingly, add missing installation rules, etc. Also unscreamify and indent many CMakeLists.txt in the process.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@6552 3bd1e089-480b-0410-8dfb-8563597acbee
parent 1ff80ccd
PROJECT( Applications ) project(Applications)
IF(BUILD_CLI) if(BUILD_CLI)
SUBDIRS(CLI) subdirs(CLI)
ENDIF(BUILD_CLI) endif(BUILD_CLI)
SUBDIRS( subdirs(
GUI GUI
#SIGN )
)
IF (Slicer3_BUILD_TESTING) if(Slicer3_BUILD_TESTING)
SUBDIRS( Testing ) subdirs(Testing)
ENDIF (Slicer3_BUILD_TESTING) endif(Slicer3_BUILD_TESTING)
PROJECT( GUI ) project(GUI)
######################################################################### #########################################################################
# Enable shared link forwarding support if needed. # Enable shared link forwarding support if needed.
SET(SLICER_EXE_SUFFIX) set(SLICER_EXE_SUFFIX)
SET(SLICER_EXE_INSTALL ${SLICER_INSTALL_BIN_DIR}) set(SLICER_EXE_INSTALL ${SLICER_INSTALL_BIN_DIR})
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
SET(SLICER_NEED_SHARED_FORWARD 1) set(SLICER_NEED_SHARED_FORWARD 1)
SET(SLICER_EXE_SUFFIX -real) set(SLICER_EXE_SUFFIX -real)
SET(SLICER_EXE_INSTALL ".") set(SLICER_EXE_INSTALL ".")
SET(SLICER_FORWARD_DIR_BUILD "${EXECUTABLE_OUTPUT_PATH}") set(SLICER_FORWARD_DIR_BUILD "${EXECUTABLE_OUTPUT_PATH}")
SET(SLICER_FORWARD_DIR_INSTALL "${SLICER_EXE_INSTALL}") set(SLICER_FORWARD_DIR_INSTALL "${SLICER_EXE_INSTALL}")
SET(SLICER_FORWARD_PATH_BUILD "\"${SLICER_FORWARD_DIR_BUILD}\",\"${KWWidgets_RUNTIME_DIRS}\",\"${VTK_DIR}/bin\"") set(SLICER_FORWARD_PATH_BUILD "\"${SLICER_FORWARD_DIR_BUILD}\",\"${KWWidgets_RUNTIME_DIRS}\",\"${VTK_DIR}/bin\"")
IF(WIN32) if(WIN32)
SET(SLICER_FORWARD_PATH_INSTALL set(SLICER_FORWARD_PATH_INSTALL
"\"../lib/Slicer3/tcl/bin\"") "\"../lib/Slicer3/tcl/bin\"")
ELSE(WIN32) else(WIN32)
SET(SLICER_FORWARD_PATH_INSTALL set(SLICER_FORWARD_PATH_INSTALL
"\"../lib\",\"../lib/KWWidgets\",\"../lib/InsightToolkit\",\"../lib/Slicer3/tcl/lib\"") "\"../lib\",\"../lib/KWWidgets\",\"../lib/InsightToolkit\",\"../lib/Slicer3/tcl/lib\"")
ENDIF(WIN32) endif(WIN32)
ENDIF(BUILD_SHARED_LIBS) endif(BUILD_SHARED_LIBS)
# Add main server executables. # Add main server executables.
SET(SLICER_EXE_LIST Slicer3) set(SLICER_EXE_LIST Slicer3)
# Add shared link forwarding executables if necessary. # Add shared link forwarding executables if necessary.
IF(SLICER_NEED_SHARED_FORWARD) if(SLICER_NEED_SHARED_FORWARD)
FOREACH(slicer_exe ${SLICER_EXE_LIST}) foreach(slicer_exe ${SLICER_EXE_LIST})
SET(SLICER_FORWARD_EXE ${slicer_exe}${SLICER_EXE_SUFFIX}) set(SLICER_FORWARD_EXE ${slicer_exe}${SLICER_EXE_SUFFIX})
CONFIGURE_FILE( configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Slicer3-forward.c.in ${CMAKE_CURRENT_SOURCE_DIR}/Slicer3-forward.c.in
${CMAKE_CURRENT_BINARY_DIR}/${slicer_exe}-forward.c ${CMAKE_CURRENT_BINARY_DIR}/${slicer_exe}-forward.c
@ONLY IMMEDIATE) @ONLY IMMEDIATE)
ADD_EXECUTABLE(${slicer_exe} WIN32 add_executable(${slicer_exe} WIN32
${CMAKE_CURRENT_BINARY_DIR}/${slicer_exe}-forward.c) ${CMAKE_CURRENT_BINARY_DIR}/${slicer_exe}-forward.c)
ADD_DEPENDENCIES(${slicer_exe} ${slicer_exe}${SLICER_EXE_SUFFIX}) add_dependencies(${slicer_exe} ${slicer_exe}${SLICER_EXE_SUFFIX})
INSTALL(TARGETS ${slicer_exe} install(TARGETS ${slicer_exe}
DESTINATION bin DESTINATION bin
COMPONENT Runtime) COMPONENT Runtime)
ENDFOREACH(slicer_exe) endforeach(slicer_exe)
ENDIF(SLICER_NEED_SHARED_FORWARD) endif(SLICER_NEED_SHARED_FORWARD)
SET (SRC set(SRC
Slicer3.cxx Slicer3.cxx
) )
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Find SLICERLIBCURL (slicercurl) # Find SLICERLIBCURL (slicercurl)
FIND_PACKAGE(SLICERLIBCURL REQUIRED) find_package(SLICERLIBCURL REQUIRED)
INCLUDE(${SLICERLIBCURL_USE_FILE}) include(${SLICERLIBCURL_USE_FILE})
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Include dirs # Include dirs
# MESSAGE(STATUS "Setting up dir_list, Qdec bin dir = ${Qdec_BINARY_DIR}, Qdec src dir = ${Qdec_SOURCE_DIR}") # MESSAGE(STATUS "Setting up dir_list, Qdec bin dir = ${Qdec_BINARY_DIR}, Qdec src dir = ${Qdec_SOURCE_DIR}")
SET(dir_list set(dir_list
${SlicerBase_SOURCE_DIR} ${Slicer3_INCLUDE_DIRS}
${SlicerBase_BINARY_DIR} ${NAVITRACK_INC}
${SlicerBaseLogic_SOURCE_DIR} ${IGSTK_INCLUDE_DIRS}
${SlicerBaseLogic_BINARY_DIR}
${SlicerBaseGUI_SOURCE_DIR}
${SlicerBaseGUI_BINARY_DIR}
${MRML_SOURCE_DIR}
${MRML_BINARY_DIR}
${IGT_SOURCE_DIR}
${IGT_BINARY_DIR}
${Volumes_SOURCE_DIR} ${Volumes_SOURCE_DIR}
${Volumes_BINARY_DIR} ${Volumes_BINARY_DIR}
${Volumes_Init_SOURCE_DIR} ${Volumes_Init_SOURCE_DIR}
...@@ -95,8 +88,6 @@ SET(dir_list ...@@ -95,8 +88,6 @@ SET(dir_list
${NeuroNav_BINARY_DIR} ${NeuroNav_BINARY_DIR}
${NeuroNav_Init_SOURCE_DIR} ${NeuroNav_Init_SOURCE_DIR}
${NeuroNav_Init_BINARY_DIR} ${NeuroNav_Init_BINARY_DIR}
${Qdec_SOURCE_DIR}
${Qdec_BINARY_DIR}
${QdecModule_SOURCE_DIR} ${QdecModule_SOURCE_DIR}
${QdecModule_BINARY_DIR} ${QdecModule_BINARY_DIR}
${QdecModule_Init_SOURCE_DIR} ${QdecModule_Init_SOURCE_DIR}
...@@ -127,31 +118,22 @@ SET(dir_list ...@@ -127,31 +118,22 @@ SET(dir_list
${SlicerDaemon_BINARY_DIR} ${SlicerDaemon_BINARY_DIR}
${SlicerDaemon_Init_SOURCE_DIR} ${SlicerDaemon_Init_SOURCE_DIR}
${SlicerDaemon_Init_BINARY_DIR} ${SlicerDaemon_Init_BINARY_DIR}
${ModuleDescriptionParser_SOURCE_DIR}
${LoadableModule_SOURCE_DIR}
${LoadableModule_BINARY_DIR}
${VTK_INCLUDE_DIR}
${NAVITRACK_INC}
${IGSTK_INCLUDE_DIRS}
${RemoteIO_SOURCE_DIR}
${RemoteIO_BINARY_DIR}
${SLICERLIBCURL_INCLUDE_DIRS}
) )
IF(BUILD_MODULES) if(BUILD_MODULES)
ADD_DEFINITIONS(-DBUILD_MODULES) add_definitions(-DBUILD_MODULES)
ENDIF(BUILD_MODULES) endif(BUILD_MODULES)
IF(BUILD_CLI) if(BUILD_CLI)
ADD_DEFINITIONS(-DBUILD_CLI) add_definitions(-DBUILD_CLI)
ENDIF(BUILD_CLI) endif(BUILD_CLI)
IF(USE_PYTHON AND PYTHON_INCLUDE_PATH) if(USE_PYTHON AND PYTHON_INCLUDE_PATH)
SET(dir_list ${dir_list} ${PYTHON_INCLUDE_PATH}) set(dir_list ${dir_list} ${PYTHON_INCLUDE_PATH})
ADD_DEFINITIONS(-DUSE_PYTHON) add_definitions(-DUSE_PYTHON)
ENDIF(USE_PYTHON AND PYTHON_INCLUDE_PATH) endif(USE_PYTHON AND PYTHON_INCLUDE_PATH)
INCLUDE_DIRECTORIES(${dir_list}) include_directories(${dir_list})
# On Win32 platforms, let's configure the KWWidgets sample resource file # On Win32 platforms, let's configure the KWWidgets sample resource file
# to get a nice application icon and some additional information. # to get a nice application icon and some additional information.
...@@ -174,56 +156,49 @@ INCLUDE_DIRECTORIES(${dir_list}) ...@@ -174,56 +156,49 @@ INCLUDE_DIRECTORIES(${dir_list})
# with the WIN32_CONSOLE you can see diagnostic output on in a DOS-style # with the WIN32_CONSOLE you can see diagnostic output on in a DOS-style
# cmd window # cmd window
# #
OPTION(Slicer3_BUILD_WIN32_CONSOLE "Build Slicer3 executable as a console app on windows (allows debug output)" OFF) option(Slicer3_BUILD_WIN32_CONSOLE "Build Slicer3 executable as a console app on windows (allows debug output)" OFF)
IF ( Slicer3_BUILD_WIN32_CONSOLE ) if(Slicer3_BUILD_WIN32_CONSOLE)
ADD_EXECUTABLE (Slicer3${SLICER_EXE_SUFFIX} ${SRC} ${RC_FILENAME}) add_executable(Slicer3${SLICER_EXE_SUFFIX} ${SRC} ${RC_FILENAME})
ELSE ( Slicer3_BUILD_WIN32_CONSOLE ) else(Slicer3_BUILD_WIN32_CONSOLE)
ADD_EXECUTABLE (Slicer3${SLICER_EXE_SUFFIX} WIN32 ${SRC} ${RC_FILENAME}) add_executable(Slicer3${SLICER_EXE_SUFFIX} WIN32 ${SRC} ${RC_FILENAME})
ENDIF ( Slicer3_BUILD_WIN32_CONSOLE ) endif(Slicer3_BUILD_WIN32_CONSOLE)
IF(WFENGINEMODULE) if(WFENGINEMODULE)
SET(WFENGINE_LINK_LIB ${WFENGINE_LINK_LIB} WFEngineModule) set(WFENGINE_LINK_LIB ${WFENGINE_LINK_LIB} WFEngineModule)
ELSE(WFENGINEMODULE) else(WFENGINEMODULE)
ADD_DEFINITIONS(-DWFENGINE_DEBUG) add_definitions(-DWFENGINE_DEBUG)
ENDIF(WFENGINEMODULE) endif(WFENGINEMODULE)
# Option for VolumeRendering # Option for VolumeRendering
IF(VOLUMERENDERINGMODULE) if(VOLUMERENDERINGMODULE)
SET(VOLUMERENDERINGMODULE_LINK_LIB VolumeRenderingModule) set(VOLUMERENDERINGMODULE_LINK_LIB VolumeRenderingModule)
ELSE(VOLUMERENDERINGMODULE) else(VOLUMERENDERINGMODULE)
ADD_DEFINITIONS(-DVOLUMERENDERINGMODULE_DEBUG) add_definitions(-DVOLUMERENDERINGMODULE_DEBUG)
ENDIF(VOLUMERENDERINGMODULE) endif(VOLUMERENDERINGMODULE)
# Option for LabelStatistics # Option for LabelStatistics
IF(LABELSTATISTICS) if(LABELSTATISTICS)
SET(LABELSTATISTICS_LINK_LIB LabelStatistics) set(LABELSTATISTICS_LINK_LIB LabelStatistics)
ELSE(LABELSTATISTICS) else(LABELSTATISTICS)
ADD_DEFINITIONS(-DLABELSTATISTICS_DEBUG) add_definitions(-DLABELSTATISTICS_DEBUG)
ENDIF(LABELSTATISTICS) endif(LABELSTATISTICS)
# Important: remove RemoteIO when using CMake 2.6. Couldn't be part of
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} # Slicer3_LIBRARIES right now because of the Cult lib RemoteIO is using is
SlicerBaseLogic # STATIC, but that's fixed in 2.6.
SlicerBaseGUI
MRML target_link_libraries(Slicer3${SLICER_EXE_SUFFIX}
IGT ${Slicer3_LIBRARIES}
ModuleDescriptionParser RemoteIO
LoadableModule ${KWWidgets_LIBRARIES}
vtkITK # ${SLICERLIBCURL_LIBRARIES}
ITKCommon )
ITKIO
${KWWidgets_LIBRARIES}
Qdec
RemoteIO
${SLICERLIBCURL_LIBRARIES}
)
# MESSAGE(STATUS "Slicer lib curl libs = ${SLICERLIBCURL_LIBRARIES}") # MESSAGE(STATUS "Slicer lib curl libs = ${SLICERLIBCURL_LIBRARIES}")
# MESSAGE(STATUS "Slicer lib curl library dirs = ${SLICERLIBCURL_LIBRARY_DIRS}") # MESSAGE(STATUS "Slicer lib curl library dirs = ${SLICERLIBCURL_LIBRARY_DIRS}")
if(BUILD_MODULES)
IF(BUILD_MODULES) target_link_libraries(Slicer3${SLICER_EXE_SUFFIX}
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX}
Volumes Volumes
GradientAnisotropicDiffusionFilter GradientAnisotropicDiffusionFilter
EMSegment EMSegment
...@@ -241,29 +216,29 @@ IF(BUILD_MODULES) ...@@ -241,29 +216,29 @@ IF(BUILD_MODULES)
SlicerTractographyDisplay SlicerTractographyDisplay
SlicerTractographyFiducialSeeding SlicerTractographyFiducialSeeding
) )
ENDIF(BUILD_MODULES) endif(BUILD_MODULES)
IF(USE_PYTHON AND PYTHON_LIBRARIES) if(USE_PYTHON AND PYTHON_LIBRARIES)
ADD_DEFINITIONS(-DUSE_PYTHON) add_definitions(-DUSE_PYTHON)
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} SlicerGUIPython) target_link_libraries(Slicer3${SLICER_EXE_SUFFIX} SlicerGUIPython)
IF (WIN32 AND PYTHON_DEBUG_LIBRARIES) if(WIN32 AND PYTHON_DEBUG_LIBRARIES)
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} target_link_libraries(Slicer3${SLICER_EXE_SUFFIX}
debug ${PYTHON_DEBUG_LIBRARIES} debug ${PYTHON_DEBUG_LIBRARIES}
optimized ${PYTHON_LIBRARIES}) optimized ${PYTHON_LIBRARIES})
ELSE (WIN32 AND PYTHON_DEBUG_LIBRARIES) else(WIN32 AND PYTHON_DEBUG_LIBRARIES)
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} ${PYTHON_LIBRARIES}) target_link_libraries(Slicer3${SLICER_EXE_SUFFIX} ${PYTHON_LIBRARIES})
ENDIF (WIN32 AND PYTHON_DEBUG_LIBRARIES) endif(WIN32 AND PYTHON_DEBUG_LIBRARIES)
IF(NOT WIN32) if(NOT WIN32)
# Linux/Unix requires util library, but mac doesn't # Linux/Unix requires util library, but mac doesn't
IF (APPLE) if(APPLE)
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} ) target_link_libraries(Slicer3${SLICER_EXE_SUFFIX})
ELSE (APPLE) else(APPLE)
TARGET_LINK_LIBRARIES( Slicer3${SLICER_EXE_SUFFIX} util ) target_link_libraries(Slicer3${SLICER_EXE_SUFFIX} util)
ENDIF (APPLE) endif(APPLE)
ENDIF(NOT WIN32) endif(NOT WIN32)
ENDIF(USE_PYTHON AND PYTHON_LIBRARIES) endif(USE_PYTHON AND PYTHON_LIBRARIES)
INSTALL_TARGETS(/bin Slicer3${SLICER_EXE_SUFFIX}) install_targets(/bin Slicer3${SLICER_EXE_SUFFIX})
# Generate a lightweight C launcher for a *specific* executable. # Generate a lightweight C launcher for a *specific* executable.
# The launcher sets up all the environments variables (PATH, TCLLIBPATH, # The launcher sets up all the environments variables (PATH, TCLLIBPATH,
...@@ -275,51 +250,51 @@ INSTALL_TARGETS(/bin Slicer3${SLICER_EXE_SUFFIX}) ...@@ -275,51 +250,51 @@ INSTALL_TARGETS(/bin Slicer3${SLICER_EXE_SUFFIX})
# stored together in the installation tree, and a launcher should not be # stored together in the installation tree, and a launcher should not be
# needed in that case). # needed in that case).
INCLUDE("${KWWidgets_CMAKE_DIR}/KWWidgetsPathsMacros.cmake") include("${KWWidgets_CMAKE_DIR}/KWWidgetsPathsMacros.cmake")
KWWidgets_GENERATE_SETUP_PATHS_LAUNCHER( kwwidgets_generate_setup_paths_launcher(
"${CMAKE_CURRENT_BINARY_DIR}" "Slicer3Launcher" "" "Slicer3-real" "${TEEM_DIR}/bin") "${CMAKE_CURRENT_BINARY_DIR}" "Slicer3Launcher" "" "Slicer3-real" "${TEEM_DIR}/bin")
# If needed, copy the Tcl/Tk support files required at run-time # If needed, copy the Tcl/Tk support files required at run-time
# to initialize Tcl/Tk. This is only triggered if VTK was built # to initialize Tcl/Tk. This is only triggered if VTK was built
# against a Tcl/Tk static library. # against a Tcl/Tk static library.
INCLUDE("${KWWidgets_CMAKE_DIR}/KWWidgetsTclTkMacros.cmake") include("${KWWidgets_CMAKE_DIR}/KWWidgetsTclTkMacros.cmake")
KWWidgets_COPY_TCL_TK_SUPPORT_FILES("${Slicer3_BINARY_DIR}/lib") kwwidgets_copy_tcl_tk_support_files("${Slicer3_BINARY_DIR}/lib")
KWWidgets_INSTALL_TCL_TK_SUPPORT_FILES("/lib") kwwidgets_install_tcl_tk_support_files("/lib")
# #
# use the command line utilities # use the command line utilities
# #
FIND_PACKAGE(GenerateCLP REQUIRED) find_package(GenerateCLP REQUIRED)
IF(GenerateCLP_FOUND) if(GenerateCLP_FOUND)
INCLUDE(${GenerateCLP_USE_FILE}) include(${GenerateCLP_USE_FILE})
ENDIF(GenerateCLP_FOUND) endif(GenerateCLP_FOUND)
GENERATECLP(${SRC} Slicer3.xml) generateclp(${SRC} Slicer3.xml)
# #
# Command line parsing tests # Command line parsing tests
# #
ADD_TEST(Slicer3CLTest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --help) add_test(Slicer3CLTest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --help)
ADD_TEST(Slicer3CLTest2 ${Slicer3_BINARY_DIR}/Slicer3 --xml --no-splash) add_test(Slicer3CLTest2 ${Slicer3_BINARY_DIR}/Slicer3 --xml --no-splash)
ADD_TEST(Slicer3CLTest3 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/TestScript.tcl) add_test(Slicer3CLTest3 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/TestScript.tcl)
ADD_TEST(Slicer3CLTest4 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --eval "puts testing ,. exit 0") add_test(Slicer3CLTest4 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --eval "puts testing ,. exit 0")
ADD_TEST(Slicer3CLTest5 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --exec "puts testing ,. exit 0") add_test(Slicer3CLTest5 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --exec "puts testing ,. exit 0")
ADD_TEST(Slicer3CLTest6 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/TestScript.tcl) add_test(Slicer3CLTest6 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/TestScript.tcl)
ADD_TEST(Slicer3CLTest7 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/LoadSceneTest.tcl) add_test(Slicer3CLTest7 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/LoadSceneTest.tcl)
ADD_TEST(Slicer3ScrollTest ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/ScrollTesting.tcl) add_test(Slicer3ScrollTest ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Applications/GUI/Testing/ScrollTesting.tcl)
# #
# MRML Tests # MRML Tests
# #
ADD_TEST(Slicer3MRMLUndo ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Libs/MRML/Testing/testUndo.tcl) add_test(Slicer3MRMLUndo ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Libs/MRML/Testing/testUndo.tcl)
ADD_TEST(Slicer3MRMLVolume ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Libs/MRML/Testing/testVolume.tcl) add_test(Slicer3MRMLVolume ${Slicer3_BINARY_DIR}/Slicer3 --no-splash -f ${Slicer3_SOURCE_DIR}/Libs/MRML/Testing/testVolume.tcl)
# #
# make the testing # make the testing
# #
IF (Slicer3_BUILD_TESTING) if(Slicer3_BUILD_TESTING)
SUBDIRS( Testing ) subdirs(Testing)
ENDIF (Slicer3_BUILD_TESTING) endif(Slicer3_BUILD_TESTING)
PROJECT( GUITesting ) project(GUITesting)
##################### #####################
FIND_PACKAGE(GenerateCLP REQUIRED) find_package(GenerateCLP REQUIRED)
IF(GenerateCLP_FOUND) if(GenerateCLP_FOUND)
INCLUDE(${GenerateCLP_USE_FILE}) include(${GenerateCLP_USE_FILE})
ENDIF(GenerateCLP_FOUND) endif(GenerateCLP_FOUND)
FIND_PACKAGE(vtkITK REQUIRED) find_package(vtkITK REQUIRED)
LINK_DIRECTORIES(${ModuleDescriptionParser_BINARY_DIR}) link_directories(${ModuleDescriptionParser_BINARY_DIR})
FIND_PACKAGE(ITK REQUIRED) find_package(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE}) include(${ITK_USE_FILE})
FIND_PACKAGE(VTK REQUIRED) find_package(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE}) include(${VTK_USE_FILE})
set(CLP EventBrokerTest)
SET (CLP EventBrokerTest) set(${CLP}_SOURCE ${CLP}.cxx)
generateclp(${CLP}_SOURCE ${CLP}.xml ${Slicer3_SOURCE_DIR}/Resources/NAMICLogo.h)
link_directories(${vtkITK_LIB_DIR})
add_executable(${CLP} ${${CLP}_SOURCE})
target_link_libraries(${CLP}
${Slicer3_LIBRARIES}
)
SET ( ${CLP}_SOURCE ${CLP}.cxx ) include_directories(
GENERATECLP(${CLP}_SOURCE ${CLP}.xml ${Slicer3_SOURCE_DIR}/Resources/NAMICLogo.h) ${Slicer3_INCLUDE_DIRS}
LINK_DIRECTORIES(${vtkITK_LIB_DIR}) )
ADD_EXECUTABLE(${CLP} ${${CLP}_SOURCE})
TARGET_LINK_LIBRARIES (${CLP}
vtkITK vtkImaging vtkGraphics vtkIO
ITKIO
ModuleDescriptionParser
MRML
)
INCLUDE_DIRECTORIES( set(TEMP "${Slicer3_BINARY_DIR}/Testing/Temporary")
${vtkITK_SOURCE_DIR} add_test(EventBrokerTest
${vtkITK_BINARY_DIR}
${MRML_SOURCE_DIR} ${MRML_BINARY_DIR}
)
SET(TEMP "${Slicer3_BINARY_DIR}/Testing/Temporary")
ADD_TEST(EventBrokerTest
${Slicer3_BINARY_DIR}/Slicer3 --launch EventBrokerTest --logFileName ${TEMP}/EventLog.dot --graphFile ${TEMP}/EventBroker.dot) ${Slicer3_BINARY_DIR}/Slicer3 --launch EventBrokerTest --logFileName ${TEMP}/EventLog.dot --graphFile ${TEMP}/EventBroker.dot)
PROJECT(SlicerBaseCLI) project(SlicerBaseCLI)
CONFIGURE_FILE( configure_file(
${SlicerBaseCLI_SOURCE_DIR}/vtkSlicerBaseCLIConfigure.h.in ${SlicerBaseCLI_SOURCE_DIR}/vtkSlicerBaseCLIConfigure.h.in
${SlicerBaseCLI_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h ${SlicerBaseCLI_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h
) )
set(include_dirs
INCLUDE_DIRECTORIES(
${ModuleDescriptionParser_BINARY_DIR}
${ModuleDescriptionParser_SOURCE_DIR}
${SlicerBaseCLI_BINARY_DIR} ${SlicerBaseCLI_BINARY_DIR}
${SlicerBaseCLI_SOURCE_DIR} ${SlicerBaseCLI_SOURCE_DIR}
) ${ModuleDescriptionParser_BINARY_DIR}
${ModuleDescriptionParser_SOURCE_DIR}
)
include_directories(${include_dirs})
GET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS tmp)
SET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS ${tmp} ${include_dirs})
# #
# Single library target. Down the road, we may want to have one library that only depends # Single library target. Down the road, we may want to have one library that
# on ITK and a second library that only depends on VTK # only depends on ITK and a second library that only depends on VTK
# #
SET(SlicerBaseCLI_SRCS set(SlicerBaseCLI_SRCS
vtkPluginFilterWatcher.cxx) vtkPluginFilterWatcher.cxx)
ADD_LIBRARY(SlicerBaseCLI ${SlicerBaseCLI_SRCS}) add_library(SlicerBaseCLI ${SlicerBaseCLI_SRCS})
TARGET_LINK_LIBRARIES(SlicerBaseCLI vtkCommon ModuleDescriptionParser) target_link_libraries(SlicerBaseCLI vtkCommon ModuleDescriptionParser)
GET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES tmp)
IF(BUILD_SHARED_LIBS) SET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES ${tmp} SlicerBaseCLI)
INSTALL(TARGETS SlicerBaseCLI
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries if(BUILD_SHARED_LIBS)
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries install(TARGETS SlicerBaseCLI
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development) RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
ENDIF(BUILD_SHARED_LIBS) LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
INSTALL(FILES itkPluginFilterWatcher.h itkPluginUtilities.h vtkPluginFilterWatcher.h vtkSlicerBaseCLIWin32Header.h endif(BUILD_SHARED_LIBS)
${SlicerBaseCLI_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h
DESTINATION include/Slicer3 COMPONENT Development) install(FILES
itkPluginFilterWatcher.h
itkPluginUtilities.h
vtkPluginFilterWatcher.h
vtkSlicerBaseCLIWin32Header.h
${SlicerBaseCLI_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h
DESTINATION include/Slicer3 COMPONENT Development)
PROJECT( SlicerBase ) project(SlicerBase)
SUBDIRS( subdirs(
Logic