Commit 940ff43b authored by barre's avatar barre

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)
SUBDIRS(CLI)
ENDIF(BUILD_CLI)
if(BUILD_CLI)
subdirs(CLI)
endif(BUILD_CLI)
SUBDIRS(
subdirs(
GUI
#SIGN
)
)
IF (Slicer3_BUILD_TESTING)
SUBDIRS( Testing )
ENDIF (Slicer3_BUILD_TESTING)
if(Slicer3_BUILD_TESTING)
subdirs(Testing)
endif(Slicer3_BUILD_TESTING)
This diff is collapsed.
PROJECT( GUITesting )
project(GUITesting)
#####################
FIND_PACKAGE(GenerateCLP REQUIRED)
IF(GenerateCLP_FOUND)
INCLUDE(${GenerateCLP_USE_FILE})
ENDIF(GenerateCLP_FOUND)
find_package(GenerateCLP REQUIRED)
if(GenerateCLP_FOUND)
include(${GenerateCLP_USE_FILE})
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)
INCLUDE(${ITK_USE_FILE})
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
find_package(VTK REQUIRED)
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 )
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}
vtkITK vtkImaging vtkGraphics vtkIO
ITKIO
ModuleDescriptionParser
MRML
)
include_directories(
${Slicer3_INCLUDE_DIRS}
)
INCLUDE_DIRECTORIES(
${vtkITK_SOURCE_DIR}
${vtkITK_BINARY_DIR}
${MRML_SOURCE_DIR} ${MRML_BINARY_DIR}
)
SET(TEMP "${Slicer3_BINARY_DIR}/Testing/Temporary")
ADD_TEST(EventBrokerTest
set(TEMP "${Slicer3_BINARY_DIR}/Testing/Temporary")
add_test(EventBrokerTest
${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_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h
)
)
INCLUDE_DIRECTORIES(
${ModuleDescriptionParser_BINARY_DIR}
${ModuleDescriptionParser_SOURCE_DIR}
set(include_dirs
${SlicerBaseCLI_BINARY_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
# on ITK and a second library that only depends on VTK
# Single library target. Down the road, we may want to have one library that
# only depends on ITK and a second library that only depends on VTK
#
SET(SlicerBaseCLI_SRCS
vtkPluginFilterWatcher.cxx)
ADD_LIBRARY(SlicerBaseCLI ${SlicerBaseCLI_SRCS})
TARGET_LINK_LIBRARIES(SlicerBaseCLI vtkCommon ModuleDescriptionParser)
IF(BUILD_SHARED_LIBS)
INSTALL(TARGETS SlicerBaseCLI
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
ENDIF(BUILD_SHARED_LIBS)
INSTALL(FILES itkPluginFilterWatcher.h itkPluginUtilities.h vtkPluginFilterWatcher.h vtkSlicerBaseCLIWin32Header.h
${SlicerBaseCLI_BINARY_DIR}/vtkSlicerBaseCLIConfigure.h
DESTINATION include/Slicer3 COMPONENT Development)
set(SlicerBaseCLI_SRCS
vtkPluginFilterWatcher.cxx)
add_library(SlicerBaseCLI ${SlicerBaseCLI_SRCS})
target_link_libraries(SlicerBaseCLI vtkCommon ModuleDescriptionParser)
GET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES tmp)
SET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES ${tmp} SlicerBaseCLI)
if(BUILD_SHARED_LIBS)
install(TARGETS SlicerBaseCLI
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
endif(BUILD_SHARED_LIBS)
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(
Logic
GUI
CLI
)
subdirs(
Logic
GUI
CLI
)
if(Slicer3_BUILD_TESTING)
subdirs(Testing)
endif(Slicer3_BUILD_TESTING)
IF (Slicer3_BUILD_TESTING)
SUBDIRS( Testing )
ENDIF (Slicer3_BUILD_TESTING)
CONFIGURE_FILE(
configure_file(
${SlicerBase_SOURCE_DIR}/vtkSlicerConfigure.h.in
${SlicerBase_BINARY_DIR}/vtkSlicerConfigure.h
)
)
GET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS tmp)
SET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS ${tmp} ${SlicerBase_BINARY_DIR})
PROJECT(SlicerBaseGUI)
project(SlicerBaseGUI)
# If we are not in the KWWidgets source tree, make sure we can find KWWidgets
# as an external package, and use it.
FIND_PACKAGE(KWWidgets REQUIRED)
INCLUDE(${KWWidgets_USE_FILE})
find_package(KWWidgets REQUIRED)
include(${KWWidgets_USE_FILE})
# The name of our targets (executable or libraries) will simply be based
# on the project name, with an extra prefix and suffix.
SET(TARGET_BASE_NAME "Slicer3${PROJECT_NAME}Test")
set(TARGET_BASE_NAME "Slicer3${PROJECT_NAME}Test")
# We actually define a class in this example, and we want to be able to
# use its callbacks from our user interface. To do so, we need to create
# a library and wrap it automatically for the Tcl language.
SET(LIB_NAME "SlicerBaseGUI")
SET(LIB_SRCS
set(LIB_NAME "SlicerBaseGUI")
set(LIB_SRCS
vtkSlicerStyle.cxx
vtkSlicerWindow.cxx
vtkSlicerApplicationSettingsInterface.cxx
......@@ -99,70 +98,87 @@ SET(LIB_SRCS
# Helper classes
#SET_SOURCE_FILES_PROPERTIES(
# none yet
# vtkSlicerGUIUpdate.cxx
# vtkSlicerLogicUpdate.cxx
# vtkSlicerMRMLUpdate.cxx
# WRAP_EXCLUDE
# )
INCLUDE_DIRECTORIES(
${SlicerBase_SOURCE_DIR}
${SlicerBase_BINARY_DIR}
# none yet
# vtkSlicerGUIUpdate.cxx
# vtkSlicerLogicUpdate.cxx
# vtkSlicerMRMLUpdate.cxx
# WRAP_EXCLUDE
# )
configure_file(
${SlicerBaseGUI_SOURCE_DIR}/vtkSlicerBaseGUIConfigure.h.in
${SlicerBaseGUI_BINARY_DIR}/vtkSlicerBaseGUIConfigure.h
)
set(include_dirs
${SlicerBaseGUI_SOURCE_DIR}
${SlicerBaseGUI_BINARY_DIR}
${SlicerBaseLogic_SOURCE_DIR}
${SlicerBaseLogic_BINARY_DIR}
${MRML_SOURCE_DIR}
${MRML_BINARY_DIR}
${VTKITK_SOURCE_DIR}/Libs/vtkITK
${VTK_INCLUDE_DIR}
${TEEM_INCLUDE_DIR}
${vtkTeem_SOURCE_DIR}
${vtkTeem_BINARY_DIR}
${ModuleDescriptionParser_SOURCE_DIR}
${ModuleDescriptionParser_BINARY_DIR}
${LoadableModule_SOURCE_DIR}
${LoadableModule_BINARY_DIR}
${FreeSurfer_SOURCE_DIR}
${FreeSurfer_BINARY_DIR}
${OPENTRACKER_INC_DIR}
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
KWWidgets_WRAP_TCL(${LIB_NAME} LIB_TCL_SRCS "${LIB_SRCS}" "")
include_directories(${include_dirs})
GET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS tmp)
SET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS ${tmp} ${include_dirs})
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
install(FILES
${files}
${SlicerBaseGUI_BINARY_DIR}/vtkSlicerBaseGUIConfigure.h
DESTINATION include/Slicer3 COMPONENT Development
)
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/Resources/*.h")
install(FILES
${files}
DESTINATION include/Slicer3/Resources COMPONENT Development
)
include("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
kwwidgets_wrap_tcl(${LIB_NAME} LIB_TCL_SRCS "${LIB_SRCS}" "")
# Create the library.
ADD_LIBRARY(${LIB_NAME} ${LIB_TCL_SRCS} ${LIB_SRCS})
TARGET_LINK_LIBRARIES(${LIB_NAME}
add_library(${LIB_NAME} ${LIB_TCL_SRCS} ${LIB_SRCS})
GET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES tmp)
SET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES ${tmp} ${LIB_NAME})
target_link_libraries(${LIB_NAME}
${KWWidgets_LIBRARIES}
ModuleDescriptionParser
SlicerBaseLogic
FreeSurfer
)
IF(BUILD_SHARED_LIBS)
INSTALL(TARGETS ${LIB_NAME}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
ENDIF(BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
install(TARGETS ${LIB_NAME}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
endif(BUILD_SHARED_LIBS)
# The name of our executable and the corresponding source file.
SET(EXE_NAME "${TARGET_BASE_NAME}")
SET(EXE_SRCS "${EXE_NAME}.cxx")
set(EXE_NAME "${TARGET_BASE_NAME}")
set(EXE_SRCS "${EXE_NAME}.cxx")
# On Win32 platforms, let's configure the KWWidgets sample resource file
# to get a nice application icon and some additional information.
IF(WIN32 AND NOT BORLAND AND NOT CYGWIN)
INCLUDE_DIRECTORIES(${VTK_TK_RESOURCES_DIR})
SET(RES_FILE "${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.rc")
SET(KWWidgets_RESOURCE_APPLICATION_NAME "${EXE_NAME}")
SET(KWWidgets_RESOURCE_FILE_NAME "${EXE_NAME}")
CONFIGURE_FILE(${KWWidgets_RESOURCES_DIR}/KWWidgets.rc.in ${RES_FILE})
ENDIF(WIN32 AND NOT BORLAND AND NOT CYGWIN)
if(WIN32 AND NOT BORLAND AND NOT CYGWIN)
include_directories(${VTK_TK_RESOURCES_DIR})
set(RES_FILE "${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.rc")
set(KWWidgets_RESOURCE_APPLICATION_NAME "${EXE_NAME}")
set(KWWidgets_RESOURCE_FILE_NAME "${EXE_NAME}")
configure_file(${KWWidgets_RESOURCES_DIR}/KWWidgets.rc.in ${RES_FILE})
endif(WIN32 AND NOT BORLAND AND NOT CYGWIN)
# Create the executable, and link it against the KWWidgets libraries and our
# own library.
......@@ -174,11 +190,11 @@ ENDIF(WIN32 AND NOT BORLAND AND NOT CYGWIN)
#### ADD_TEST(Test${EXE_NAME} ${EXECUTABLE_OUTPUT_PATH}/${EXE_NAME} --test)
#### ENDIF(BUILD_TESTING)
IF(BUILD_TESTING)
ADD_TEST(Slicer3GUITest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestSliceController.tcl)
ADD_TEST(Slicer3GUITest2 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestProgressDialog.tcl)
ADD_TEST(Slicer3FiducialsTest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestFiducials.tcl)
ENDIF(BUILD_TESTING)
if(BUILD_TESTING)
add_test(Slicer3GUITest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestSliceController.tcl)
add_test(Slicer3GUITest2 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestProgressDialog.tcl)
add_test(Slicer3FiducialsTest1 ${Slicer3_BINARY_DIR}/Slicer3 --no-splash --script ${Slicer3_SOURCE_DIR}/Base/GUI/Testing/TestFiducials.tcl)
endif(BUILD_TESTING)
# If needed, copy the Tcl/Tk support files required at run-time
# to initialize Tcl/Tk. This is only triggered if VTK was built
......@@ -200,62 +216,53 @@ ENDIF(BUILD_TESTING)
# based on KWWidgets, you can most likely omit this section too, unless
# your application supports that feature too.
INCLUDE_DIRECTORIES(
${SlicerBaseGUI_BINARY_DIR}
${OPENTRACKER_INC_DIR}
)
CONFIGURE_FILE(
${SlicerBaseGUI_SOURCE_DIR}/vtkSlicerBaseGUIConfigure.h.in
${SlicerBaseGUI_BINARY_DIR}/vtkSlicerBaseGUIConfigure.h
)
#
# install the tcl package for the gui
#
SET(SlicerBaseGUITcl_DIR "${SLICER_LIBRARIES_DIR}/SlicerBaseGUITcl")
set(SlicerBaseGUITcl_DIR "${SLICER_LIBRARIES_DIR}/SlicerBaseGUITcl")
FILE(MAKE_DIRECTORY ${SlicerBaseGUITcl_DIR})
file(MAKE_DIRECTORY ${SlicerBaseGUITcl_DIR})
SET(TCLFILES
set(TCLFILES
pkgIndex.tcl SliceViewerInteractor.tcl
SWidget.tcl SliceSWidget.tcl SeedSWidget.tcl CsysSWidget.tcl
FiducialsSWidget.tcl GridSWidget.tcl CrosshairSWidget.tcl RegionsSWidget.tcl
Slicer2Import.tcl XcedeCatalogImport.tcl XcatalogImport.tcl
XnatXcatImport.tcl Loader.tcl LoadVolume.tcl FilteredDirectoryDialog.tcl
XnatPublishScene.tcl MRMLWatcher.tcl
)
)
FOREACH(tclfile ${TCLFILES})
CONFIGURE_FILE(
foreach(tclfile ${TCLFILES})
configure_file(
${Slicer3_SOURCE_DIR}/Base/GUI/Tcl/${tclfile}
${SlicerBaseGUITcl_DIR}/${tclfile}
COPYONLY
)
ENDFOREACH(tclfile)
)
endforeach(tclfile)
# Python settings
IF(USE_PYTHON AND PYTHON_INCLUDE_PATH)
SUBDIRS(Python)
ADD_DEFINITIONS(-DUSE_PYTHON)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
IF (WIN32 AND PYTHON_DEBUG_LIBRARIES)
TARGET_LINK_LIBRARIES( ${LIB_NAME}
debug ${PYTHON_DEBUG_LIBRARIES}
optimized ${PYTHON_LIBRARIES})
ELSE (WIN32 AND PYTHON_DEBUG_LIBRARIES)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${PYTHON_LIBRARIES})
ENDIF (WIN32 AND PYTHON_DEBUG_LIBRARIES)
IF(NOT WIN32)
IF (APPLE)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${PYTHON_LIBRARIES} )
ELSE (APPLE)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${PYTHON_LIBRARIES} util)
ENDIF (APPLE)
ENDIF(NOT WIN32)
ENDIF(USE_PYTHON AND PYTHON_INCLUDE_PATH)
if(USE_PYTHON AND PYTHON_INCLUDE_PATH)
subdirs(Python)
add_definitions(-DUSE_PYTHON)
include_directories(${PYTHON_INCLUDE_PATH})
if (WIN32 AND PYTHON_DEBUG_LIBRARIES)
target_link_libraries(${LIB_NAME}
debug ${PYTHON_DEBUG_LIBRARIES}
optimized ${PYTHON_LIBRARIES})
else (WIN32 AND PYTHON_DEBUG_LIBRARIES)
target_link_libraries(${LIB_NAME} ${PYTHON_LIBRARIES})
endif (WIN32 AND PYTHON_DEBUG_LIBRARIES)
if(NOT WIN32)
if (APPLE)
target_link_libraries(${LIB_NAME} ${PYTHON_LIBRARIES})
else (APPLE)
target_link_libraries(${LIB_NAME} ${PYTHON_LIBRARIES} util)
endif (APPLE)
endif(NOT WIN32)
endif(USE_PYTHON AND PYTHON_INCLUDE_PATH)
# CMAke 2.4 does not have INSTALL(DIRECTORY ...) do it manually
#INSTALL(DIRECTORY "${Slicer3_BINARY_DIR}/SlicerBaseGUITcl"
# DESTINATION ${SLICER_INSTALL_LIBRARIES_DIR})
INSTALL(CODE "EXECUTE_PROCESS\(COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${SLICER_LIBRARIES_DIR}/SlicerBaseGUITcl\" \"\${CMAKE_INSTALL_PREFIX}/${SLICER_INSTALL_LIBRARIES_DIR}/SlicerBaseGUITcl\"\)")
install(CODE "EXECUTE_PROCESS\(COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${SLICER_LIBRARIES_DIR}/SlicerBaseGUITcl\" \"\${CMAKE_INSTALL_PREFIX}/${SLICER_INSTALL_LIBRARIES_DIR}/SlicerBaseGUITcl\"\)")
PROJECT(SlicerBaseLogic)
project(SlicerBaseLogic)
# --------------------------------------------------------------------------
# Sources
SET(SlicerBaseLogic_SRCS
set(SlicerBaseLogic_SRCS
# Logic classes (data management and calculation)
vtkSlicerLogic.cxx
vtkSlicerApplicationLogic.cxx
......@@ -30,67 +30,81 @@ SET(SlicerBaseLogic_SRCS
vtkImageLabelChange.cxx
vtkImageErode.cxx
vtkImageNeighborhoodFilter.cxx
)
)
# Abstract/pure virtual classes
#SET_SOURCE_FILES_PROPERTIES(
# <classname>.cxx
#PROPERTIES
#ABSTRACT "TRUE"
#)
# <classname>.cxx
#PROPERTIES
#ABSTRACT "TRUE"
#)
# Helper classes
#SET_SOURCE_FILES_PROPERTIES(
# <classname>.cxx
#PROPERTIES
#WRAP_EXCLUDE "TRUE"
#)
# <classname>.cxx
#PROPERTIES
#WRAP_EXCLUDE "TRUE"
#)
configure_file(
${SlicerBaseLogic_SOURCE_DIR}/vtkSlicerBaseLogicConfigure.h.in
${SlicerBaseLogic_BINARY_DIR}/vtkSlicerBaseLogicConfigure.h
)
# --------------------------------------------------------------------------
# Include dirs
INCLUDE_DIRECTORIES(
set(include_dirs
${SlicerBaseLogic_SOURCE_DIR}
${SlicerBaseLogic_BINARY_DIR}
${MRML_SOURCE_DIR}
${MRML_BINARY_DIR}
${VTK_INCLUDE_DIR}
${vtkTeem_SOURCE_DIR}
${vtkTeem_BINARY_DIR}
${SlicerBase_BINARY_DIR}
${OPENTRACKER_INC_DIR}
${FreeSurfer_SOURCE_DIR}
${FreeSurfer_BINARY_DIR}
)
include_directories(${include_dirs})
GET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS tmp)
SET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS ${tmp} ${include_dirs})
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
install(FILES
${files}
${SlicerBaseLogic_BINARY_DIR}/vtkSlicerBaseLogicConfigure.h
DESTINATION include/Slicer3 COMPONENT Development
)
# --------------------------------------------------------------------------
# Wrapping
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE("${VTK_CMAKE_DIR}/vtkWrapTcl.cmake")
SET(VTK_WRAP_HINTS ${SlicerBaseLogic_SOURCE_DIR}/Wrapping/Tcl/hints)
VTK_WRAP_TCL3(SlicerBaseLogic SlicerBaseLogic_TCL_SRCS "${SlicerBaseLogic_SRCS}" "")
include("${VTK_CMAKE_DIR}/vtkWrapTcl.cmake")
set(VTK_WRAP_HINTS ${SlicerBaseLogic_SOURCE_DIR}/Wrapping/Tcl/hints)
vtk_wrap_tcl3(SlicerBaseLogic SlicerBaseLogic_TCL_SRCS "${SlicerBaseLogic_SRCS}" "")
# --------------------------------------------------------------------------
# Build the library
ADD_LIBRARY(SlicerBaseLogic
add_library(SlicerBaseLogic
${SlicerBaseLogic_SRCS} ${SlicerBaseLogic_TCL_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL(TARGETS SlicerBaseLogic
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
ENDIF(BUILD_SHARED_LIBS)
GET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES tmp)
SET_PERSISTENT_PROPERTY(Slicer3_LIBRARIES ${tmp} SlicerBaseLogic)
if(BUILD_SHARED_LIBS)
install(TARGETS SlicerBaseLogic
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/Slicer3 COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/Slicer3 COMPONENT Development)
endif(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(SlicerBaseLogic
target_link_libraries(SlicerBaseLogic
MRML
${KWWidgets_LIBRARIES}
vtkITK
......@@ -104,41 +118,35 @@ TARGET_LINK_LIBRARIES(SlicerBaseLogic
vtkTeem
)
# --------------------------------------------------------------------------
# Testing (requires some of the examples)
IF(BUILD_TESTING)
SUBDIRS(Testing)
ENDIF(BUILD_TESTING)
CONFIGURE_FILE(
${SlicerBaseLogic_SOURCE_DIR}/vtkSlicerBaseLogicConfigure.h.in
${SlicerBaseLogic_BINARY_DIR}/vtkSlicerBaseLogicConfigure.h
)
if(BUILD_TESTING)
subdirs(Testing)
endif(BUILD_TESTING)
# --------------------------------------------------------------------------
# Resources
SET (COLORFILES
./Resources/ColorFiles/PelvisColor.txt
./Resources/ColorFiles/64Color-Nonsemantic.txt
./Resources/ColorFiles/SPL-BrainAtlas-ColorFile.txt
./Resources/ColorFiles/AbdomenColors.txt
)
SET (Color_DIR ${SLICER_LIBRARIES_DIR}/Base/Logic)
IF (NOT EXISTS ${Color_DIR})
FILE(MAKE_DIRECTORY ${Color_DIR})
ENDIF (NOT EXISTS ${Color_DIR})
FOREACH ( colorfile ${COLORFILES})
CONFIGURE_FILE(
${SlicerBaseLogic_SOURCE_DIR}/${colorfile}
${Color_DIR}/${colorfile}
COPYONLY
)
INSTALL(
FILES ${Color_DIR}/${colorfile}
DESTINATION lib/Slicer3/Base/Logic/Resources/ColorFiles
)
ENDFOREACH(colorfile)
set(COLORFILES
./Resources/ColorFiles/PelvisColor.txt
./Resources/ColorFiles/64Color-Nonsemantic.txt
./Resources/ColorFiles/SPL-BrainAtlas-ColorFile.txt
./Resources/ColorFiles/AbdomenColors.txt
)
set(Color_DIR ${SLICER_LIBRARIES_DIR}/Base/Logic)
if(NOT EXISTS ${Color_DIR})
file(MAKE_DIRECTORY ${Color_DIR})
endif(NOT EXISTS ${Color_DIR})
foreach(colorfile ${COLORFILES})
configure_file(
${SlicerBaseLogic_SOURCE_DIR}/${colorfile}
${Color_DIR}/${colorfile}
COPYONLY
)
install(
FILES ${Color_DIR}/${colorfile}
DESTINATION lib/Slicer3/Base/Logic/Resources/ColorFiles
)
endforeach(colorfile)
This diff is collapsed.
......@@ -24,20 +24,23 @@ SET(ModuleDescriptionParser_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/ModuleDescript
SET(LoadableModule_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/LoadableModule)
SET(GenerateCLP_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/GenerateCLP)
SET(GenerateCLP_USE_FILE_CONFIG ${Slicer3_BINARY_DIR}/Libs/GenerateCLP/UseGenerateCLP.cmake)
SET(Slicer3_INCLUDE_DIRS_CONFIG ${Slicer3_BINARY_DIR}/Libs/MRML ${Slicer3_SOURCE_DIR}/Libs/MRML ${Slicer3_BINARY_DIR}/Base/CLI ${Slicer3_SOURCE_DIR}/Base/CLI)
SET(Slicer3_INCLUDE_DIRS_CONFIG ${Slicer3_INCLUDE_DIRS})
SET(Slicer3_LIBRARY_DIRS_CONFIG ${Slicer3_BINARY_DIR}/bin)
SET(ITK_DIR_CONFIG ${ITK_DIR})
SET(VTK_DIR_CONFIG ${VTK_DIR})
SET(KWWidgets_DIR_CONFIG ${KWWidgets_DIR})
# Configure Slicer3Config.cmake for the install tree.
CONFIGURE_FILE(${Slicer3_SOURCE_DIR}/Slicer3Config.cmake.in
${Slicer3_BINARY_DIR}/Slicer3Config.cmake @ONLY IMMEDIATE)
CONFIGURE_FILE(
${Slicer3_SOURCE_DIR}/Slicer3Config.cmake.in
${Slicer3_BINARY_DIR}/Slicer3Config.cmake @ONLY IMMEDIATE)
# Settings specific for installation trees
#
# (Note we configure from a different file than use for the build tree)
# Configure Slicer3Config.cmake for the install tree.
CONFIGURE_FILE(${Slicer3_SOURCE_DIR}/Slicer3InstallConfig.cmake.in
${Slicer3_BINARY_DIR}/Utilities/Slicer3Config.cmake @ONLY IMMEDIATE)
CONFIGURE_FILE(
${Slicer3_SOURCE_DIR}/Slicer3InstallConfig.cmake.in
${Slicer3_BINARY_DIR}/Utilities/Slicer3Config.cmake @ONLY IMMEDIATE)
PROJECT(FreeSurfer)
project(FreeSurfer)
CONFIGURE_FILE(
configure_file(
${FreeSurfer_SOURCE_DIR}/FreeSurferConfigure.h.in
${FreeSurfer_BINARY_DIR}/FreeSurferConfigure.h
)
)
# --------------------------------------------------------------------------
# Sources
SET(FreeSurfer_SRCS
vtkFSIO.cxx
vtkFSSurfaceReader.cxx
vtkFSSurfaceAnnotationReader.cxx
vtkFSSurfaceScalarReader.cxx
vtkFSSurfaceWFileReader.cxx
vtkFSLookupTable.cxx
)
set(FreeSurfer_SRCS
vtkFSIO.cxx
vtkFSSurfaceReader.cxx
vtkFSSurfaceAnnotationReader.cxx
vtkFSSurfaceScalarReader.cxx
vtkFSSurfaceWFileReader.cxx
vtkFSLookupTable.cxx
)
# Abstract/pure virtual classes
......@@ -28,56 +27,63 @@ SET(FreeSurfer_SRCS
# --------------------------------------------------------------------------
# Include dirs
INCLUDE_DIRECTORIES(
set(include_dirs
${FreeSurfer_SOURCE_DIR}
${FreeSurfer_BINARY_DIR}
${VTK_INCLUDE_DIR}
)
include_directories(${include_dirs})
GET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS tmp)
SET_PERSISTENT_PROPERTY(Slicer3_INCLUDE_DIRS ${tmp} ${include_dirs})
# --------------------------------------------------------------------------
# Wrapping
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE("${VTK_CMAKE_DIR}/vtkWrapTcl.cmake")
VTK_WRAP_TCL3(FreeSurfer FreeSurfer_TCL_SRCS "${FreeSurfer_SRCS}" "")
include("${VTK_CMAKE_DIR}/vtkWrapTcl.cmake")