itksnap/ 0000755 0000765 0000024 00000000000 11560342171 011544 5 ustar pauly staff itksnap/CMake/ 0000755 0000765 0000024 00000000000 11560342170 012523 5 ustar pauly staff itksnap/CMake/CustomBuildSettings.cmake 0000644 0000765 0000024 00000002112 10735760673 017513 0 ustar pauly staff SITE_NAME(SNAP_BUILD_MACHINE)
SET(INSTALL_LIBS lib/snap-${SNAP_VERSION_FULL})
IF(SNAP_BUILD_MACHINE STREQUAL "pauly-laptop" AND NOT WIN32)
INSTALL(
FILES /usr/lib/libstdc++.so.6.0.9
DESTINATION ${INSTALL_LIBS}
COMPONENT RUNTIME
RENAME libstdc++.so.6)
INSTALL(
FILES /lib/libgcc_s.so.1
DESTINATION ${INSTALL_LIBS}
COMPONENT RUNTIME)
INSTALL(
FILES /usr/lib/libGLU.so.1.3.070001
DESTINATION ${INSTALL_LIBS}
RENAME libGLU.so.1
COMPONENT RUNTIME)
ENDIF(SNAP_BUILD_MACHINE STREQUAL "pauly-laptop" AND NOT WIN32)
IF(SNAP_BUILD_MACHINE STREQUAL "mingus.uphs.upenn.edu" AND NOT WIN32)
INSTALL(
FILES /usr/lib/libstdc++.so.5.0.3
DESTINATION ${INSTALL_LIBS}
COMPONENT RUNTIME
RENAME libstdc++.so.5)
INSTALL(
FILES /lib/libgcc_s-3.2.2-20030225.so.1
DESTINATION ${INSTALL_LIBS}
RENAME libgcc_s.so.1
COMPONENT RUNTIME)
INSTALL(
FILES /usr/X11R6/lib/libGLU.so.1.3
DESTINATION ${INSTALL_LIBS}
RENAME libGLU.so.1
COMPONENT RUNTIME)
ENDIF(SNAP_BUILD_MACHINE STREQUAL "mingus.uphs.upenn.edu" AND NOT WIN32)
itksnap/CMake/CVS/ 0000755 0000765 0000024 00000000000 11560342170 013156 5 ustar pauly staff itksnap/CMake/CVS/Entries 0000644 0000765 0000024 00000000241 11560342170 014507 0 ustar pauly staff /CustomBuildSettings.cmake/1.2/Sun Dec 30 18:21:47 2007//
/find_fltk_13.cmake/1.6/Wed May 4 15:01:47 2011//
/standalone.cmake/1.12/Sat Oct 23 10:26:41 2010//
D
itksnap/CMake/CVS/Repository 0000644 0000765 0000024 00000000016 11560342170 015255 0 ustar pauly staff itksnap/CMake
itksnap/CMake/CVS/Root 0000644 0000765 0000024 00000000100 11560342170 014013 0 ustar pauly staff :ext:pyushkevich@itk-snap.cvs.sourceforge.net:/cvsroot/itk-snap
itksnap/CMake/find_fltk_13.cmake 0000644 0000765 0000024 00000013453 11560265133 016001 0 ustar pauly staff # This script sets up FLTK 1.3 because FindFLTK does not work very well
# The name of the FLTK library will vary depending on the system
# Options are libfltk_forms.a fltkforms.lib and fltkformsd.lib
IF(MSVC)
SET(PREF "")
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(SUFF "d")
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(SUFF "")
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
ELSE(MSVC)
SET(PREF "_")
SET(SUFF "")
ENDIF(MSVC)
# What is the target name of the fltk library
SET(BASETARG "fltk${SUFF}")
# Search for the base library
FIND_LIBRARY(FLTK_BASE_LIBRARY NAMES ${BASETARG} PATHS "/usr/lib" "/usr/local/lib")
IF(FLTK_BASE_LIBRARY)
MESSAGE(STATUS "FLTK base: ${FLTK_BASE_LIBRARY}")
# Search for the other libraries
GET_FILENAME_COMPONENT(FLTK_LIB_DIR ${FLTK_BASE_LIBRARY} PATH)
MESSAGE(STATUS "FLTK lib dir: ${FLTK_LIB_DIR}")
MESSAGE(STATUS "FLTK target: fltk${PREF}forms${SUFF}")
FIND_LIBRARY(FLTK_FORMS_LIBRARY NAMES "fltk${PREF}forms${SUFF}" PATHS ${FLTK_LIB_DIR})
FIND_LIBRARY(FLTK_GL_LIBRARY NAMES "fltk${PREF}gl${SUFF}" PATHS ${FLTK_LIB_DIR})
FIND_LIBRARY(FLTK_IMAGES_LIBRARY NAMES "fltk${PREF}images${SUFF}" PATHS ${FLTK_LIB_DIR})
# Search for the fluid executable. It can be in a couple of places.
# 1. In the bin directory, same level as lib
# 2. In the fluid directiry, same level as lib (if built 'in-place')
GET_FILENAME_COMPONENT(FLTK_ROOT_DIR ${FLTK_LIB_DIR} PATH)
FIND_PROGRAM(FLTK_FLUID_EXECUTABLE
NAMES "fluid${SUFF}"
PATHS "${FLTK_ROOT_DIR}/bin" "${FLTK_ROOT_DIR}/fluid")
# Search for the FLTK include directory. Again, two places to look
# 1. In the include directory
# 2. In the root directory
FIND_PATH(FLTK_INCLUDE_DIR
NAMES "FL/Fl.H"
PATHS "${FLTK_ROOT_DIR}/include" "${FLTK_ROOT_DIR}")
MESSAGE(STATUS "FLTK include directory: ${FLTK_INCLUDE_DIR}")
# For now, we let the user decide about the additional image libraries
# TODO: figure this out from fltk-config file
OPTION(SNAP_USE_FLTK_PNG "Should we link with the FLTK png library?" OFF)
OPTION(SNAP_USE_FLTK_JPEG "Should we link with the FLTK jpeg library?" OFF)
OPTION(SNAP_USE_FLTK_ZLIB "Should we link with the FLTK zlib library?" OFF)
# Look for these libs if specified
IF(SNAP_USE_FLTK_PNG)
FIND_LIBRARY(FLTK_PNG_LIBRARY NAMES "fltk${PREF}png${SUFF}" PATHS ${FLTK_LIB_DIR})
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${FLTK_PNG_LIBRARY})
IF(FLTK_PNG_LIBRARY)
SET(FLTK_PNG_LIBRARY_OK ON)
ELSE(FLTK_PNG_LIBRARY)
SET(FLTK_PNG_LIBRARY_OK OFF)
ENDIF(FLTK_PNG_LIBRARY)
ELSE(SNAP_USE_FLTK_PNG)
FIND_PACKAGE(PNG REQUIRED)
IF(PNG_FOUND)
SET(FLTK_PNG_LIBRARY_OK ON)
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${PNG_LIBRARY})
ELSE(PNG_FOUND)
SET(FLTK_PNG_LIBRARY_OK OFF)
ENDIF(PNG_FOUND)
ENDIF(SNAP_USE_FLTK_PNG)
IF(SNAP_USE_FLTK_JPEG)
FIND_LIBRARY(FLTK_JPEG_LIBRARY NAMES "fltk${PREF}jpeg${SUFF}" PATHS ${FLTK_LIB_DIR})
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${FLTK_JPEG_LIBRARY})
IF(FLTK_JPEG_LIBRARY)
SET(FLTK_JPEG_LIBRARY_OK ON)
ELSE(FLTK_JPEG_LIBRARY)
SET(FLTK_JPEG_LIBRARY_OK OFF)
ENDIF(FLTK_JPEG_LIBRARY)
ELSE(SNAP_USE_FLTK_JPEG)
FIND_PACKAGE(JPEG REQUIRED)
IF(JPEG_FOUND)
SET(FLTK_JPEG_LIBRARY_OK ON)
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${JPEG_LIBRARY})
ELSE(JPEG_FOUND)
SET(FLTK_JPEG_LIBRARY_OK OFF)
ENDIF(JPEG_FOUND)
ENDIF(SNAP_USE_FLTK_JPEG)
IF(SNAP_USE_FLTK_ZLIB)
FIND_LIBRARY(FLTK_ZLIB_LIBRARY NAMES "fltk${PREF}z${SUFF}" "zlib${SUFF}" PATHS ${FLTK_LIB_DIR})
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${FLTK_ZLIB_LIBRARY})
IF(FLTK_ZLIB_LIBRARY)
SET(FLTK_ZLIB_LIBRARY_OK ON)
ELSE(FLTK_ZLIB_LIBRARY)
SET(FLTK_ZLIB_LIBRARY_OK OFF)
ENDIF(FLTK_ZLIB_LIBRARY)
ELSE(SNAP_USE_FLTK_ZLIB)
FIND_PACKAGE(ZLIB REQUIRED)
IF(ZLIB_FOUND)
SET(FLTK_ZLIB_LIBRARY_OK ON)
SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} ${ZLIB_LIBRARY})
ELSE(ZLIB_FOUND)
SET(FLTK_ZLIB_LIBRARY_OK OFF)
ENDIF(ZLIB_FOUND)
ENDIF(SNAP_USE_FLTK_ZLIB)
ENDIF(FLTK_BASE_LIBRARY)
# Check if all components have been found
IF(FLTK_BASE_LIBRARY AND FLTK_FORMS_LIBRARY AND FLTK_GL_LIBRARY AND FLTK_IMAGES_LIBRARY
AND FLTK_INCLUDE_DIR AND FLTK_FLUID_EXECUTABLE
AND FLTK_PNG_LIBRARY_OK AND FLTK_ZLIB_LIBRARY_OK AND FLTK_JPEG_LIBRARY_OK)
SET(FLTK_FOUND ON)
ELSE(FLTK_BASE_LIBRARY AND FLTK_FORMS_LIBRARY AND FLTK_GL_LIBRARY AND FLTK_IMAGES_LIBRARY
AND FLTK_INCLUDE_DIR AND FLTK_FLUID_EXECUTABLE
AND FLTK_PNG_LIBRARY_OK AND FLTK_ZLIB_LIBRARY_OK AND FLTK_JPEG_LIBRARY_OK)
SET(FLTK_FOUND OFF)
ENDIF(FLTK_BASE_LIBRARY AND FLTK_FORMS_LIBRARY AND FLTK_GL_LIBRARY AND FLTK_IMAGES_LIBRARY
AND FLTK_INCLUDE_DIR AND FLTK_FLUID_EXECUTABLE
AND FLTK_PNG_LIBRARY_OK AND FLTK_ZLIB_LIBRARY_OK AND FLTK_JPEG_LIBRARY_OK)
# Taken from findfltk.cmake
# Platform dependent libraries required by FLTK
IF(WIN32)
IF(NOT CYGWIN)
IF(BORLAND)
SET( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
ELSE(BORLAND)
SET( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
ENDIF(BORLAND)
ENDIF(NOT CYGWIN)
ENDIF(WIN32)
IF(UNIX)
INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake)
FIND_LIBRARY(FLTK_MATH_LIBRARY m)
SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${X11_Xft_LIB} ${X11_Xinerama_LIB} ${FLTK_MATH_LIBRARY})
ENDIF(UNIX)
IF(APPLE)
SET( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -framework AudioToolbox -lz")
ENDIF(APPLE)
IF(CYGWIN)
FIND_LIBRARY(FLTK_MATH_LIBRARY m)
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ ${FLTK_MATH_LIBRARY} -lgdi32)
ENDIF(CYGWIN)
# Set the FLTK libraries
SET(FLTK_LIBRARIES
${FLTK_BASE_LIBRARY} ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY} ${FLTK_GL_LIBRARY}
${FLTK_IMAGES_LIBS} ${FLTK_PLATFORM_DEPENDENT_LIBS})
SET(FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
itksnap/CMake/standalone.cmake 0000644 0000765 0000024 00000003602 11460534141 015656 0 ustar pauly staff #############################################
# REQUIRE ITK 3.20 OR LATER #
#############################################
FIND_PACKAGE(ITK 3.20 REQUIRED)
INCLUDE(${ITK_USE_FILE})
#############################################
# REQUIRE VTK #
#############################################
FIND_PACKAGE(VTK 5.6 REQUIRED)
INCLUDE (${VTK_USE_FILE})
#############################################
# REQUIRE FLTK #
#############################################
INCLUDE(${SNAP_SOURCE_DIR}/CMake/find_fltk_13.cmake)
# Allow FLTK 1.1 for older systems. This is an optional flag
OPTION(SNAP_USE_FLTK_1_1 OFF "Build with older FLTK 1.1")
MARK_AS_ADVANCED(SNAP_USE_FLTK_1_1)
IF(SNAP_USE_FLTK_1_1)
SUBDIRS(Utilities/FLTK/Fl_Table)
SUBDIRS(Utilities/FLTK/Fl_Native_File_Chooser)
SET(FLTK_LIBRARIES fltk_table fltk_native_file_chooser ${FLTK_LIBRARIES})
SET(FLTK_INCLUDE_PATH ${FLTK_INCLUDE_PATH}
${SNAP_SOURCE_DIR}/Utilities/FLTK/Fl_Table
${SNAP_SOURCE_DIR}/Utilities/FLTK/Fl_Native_File_Chooser)
ENDIF(SNAP_USE_FLTK_1_1)
# Look for OpenGL.
FIND_PACKAGE(OpenGL REQUIRED)
# The fluid-generated fltk sources have many warnings. This macro
# will disable warnings for the generated files on some compilers.
MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.6)
IF(CMAKE_COMPILER_IS_GNUCXX)
FOREACH(f ${files})
STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")
STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)
ENDFOREACH(f)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.6)
ENDMACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS)
# Link libraries from the parent CMAKE file
LINK_LIBRARIES(ITKAlgorithms ITKCommon ITKBasicFilters)
itksnap/CMakeLists.txt 0000644 0000765 0000024 00000064663 11560060540 014320 0 ustar pauly staff #############################################
# CMAKE PRELIMINARIES #
#############################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
#############################################
# PROJECT: SNAP #
#############################################
PROJECT(SNAP)
#############################################
# VERSION INFORMATION #
#############################################
# On SNAP versions.
# =================
# The SNAP version consists of four fields: major, minor, patch and qualifier
# for example, version 1.7.3-beta has major version 1, minor version 7, patch 3
# and qualifier "-beta". Major, minor and patch must be numbers, but the qualifier
# is an arbitrary string and may be blank.
#
# Important:
# - The qualifier is just a descriptor. No two version should have the same
# major/minor/patch and different qualifiers. So it's completely wrong to
# release version 1.7.3-beta and then version 1.7.3. The right way to do it
# is to have 1.7.3-beta followed by 1.7.5-rc1 followed by 1.8.0 and so on
SET(SNAP_VERSION_MAJOR 2)
SET(SNAP_VERSION_MINOR 2)
SET(SNAP_VERSION_PATCH 0)
SET(SNAP_VERSION_QUALIFIER "")
SET(SNAP_VERSION_FULL "${SNAP_VERSION_MAJOR}.${SNAP_VERSION_MINOR}.${SNAP_VERSION_PATCH}${SNAP_VERSION_QUALIFIER}")
SET(SNAP_VERSION_RELEASE_DATE "20110504")
SET(SNAP_VERSION_LAST_COMPATIBLE_RELEASE_DATE "20090731")
SET(SNAP_VERSION_RELEASE_DATE_FORMATTED "May 4, 2011")
# Shamelessly stolen from ParaView
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "itksnap-${SNAP_VERSION_FULL}-${SNAP_VERSION_RELEASE_DATE}")
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "unknown")
EXEC_PROGRAM(uname ARGS "-m" OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
ENDIF (CMAKE_SYSTEM_PROCESSOR MATCHES "unknown")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
ELSE(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
ENDIF(CMAKE_CL_64)
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
# For Apple, we need to base the filename on the architecture
IF(CMAKE_SYSTEM_NAME MATCHES Darwin)
STRING(REPLACE ";" "-" ARCHBIT ${CMAKE_OSX_ARCHITECTURES})
SET(CPACK_SYSTEM_NAME "MacOS-${ARCHBIT}")
ENDIF(CMAKE_SYSTEM_NAME MATCHES Darwin)
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
#########################################################
# FIND PACKAGES IF BUILDING OUTSIDE INSIGHTAPPLICATIONS #
#########################################################
IF(DEFINED InsightApplications_SOURCE_DIR)
SET(BUILD_OUTSIDE_INSIGHT_APPLICATIONS FALSE CACHE BOOL
"Is SNAP being built separate from InsightApplications?")
ELSE(DEFINED InsightApplications_SOURCE_DIR)
SET(BUILD_OUTSIDE_INSIGHT_APPLICATIONS TRUE CACHE BOOL
"Is SNAP being built separate from InsightApplications?")
ENDIF(DEFINED InsightApplications_SOURCE_DIR)
IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
INCLUDE(${SNAP_SOURCE_DIR}/CMake/standalone.cmake)
ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
#############################################
# SOURCE FILE SPECIFICATION #
#############################################
# One of the files needs to be configured (to insert version info)
CONFIGURE_FILE(
${SNAP_SOURCE_DIR}/Common/SNAPCommon.cxx.in
${SNAP_BINARY_DIR}/SNAPCommon.cxx @ONLY IMMEDIATE)
# The part of the source code devoted to the SNAP application logic
# is organized into a separate library
SET(LOGIC_CXX
${SNAP_BINARY_DIR}/SNAPCommon.cxx
Common/CommandLineArgumentParser.cxx
Common/IRISException.cxx
Common/Registry.cxx
Common/SystemInterface.cxx
Common/ITKExtras/itkVoxBoCUBImageIO.cxx
Common/ITKExtras/itkVoxBoCUBImageIOFactory.cxx
Logic/Common/ColorMap.cxx
Logic/Common/ColorLabelTable.cxx
Logic/Common/ImageCoordinateGeometry.cxx
Logic/Common/ImageCoordinateTransform.cxx
Logic/Common/SegmentationStatistics.cxx
Logic/Common/SNAPRegistryIO.cxx
Logic/Common/SNAPSegmentationROISettings.cxx
Logic/Framework/GenericImageData.cxx
Logic/Framework/GlobalState.cxx
Logic/Framework/IRISApplication.cxx
Logic/Framework/IRISImageData.cxx
Logic/Framework/SNAPImageData.cxx
Logic/Framework/UndoDataManager_LabelType.cxx
Logic/ImageWrapper/GreyImageWrapper.cxx
Logic/ImageWrapper/GuidedNativeImageIO.cxx
Logic/ImageWrapper/LabelImageWrapper.cxx
Logic/ImageWrapper/LevelSetImageWrapper.cxx
Logic/ImageWrapper/RGBImageWrapper.cxx
Logic/ImageWrapper/SpeedColorMap.cxx
Logic/ImageWrapper/SpeedImageWrapper.cxx
Logic/LevelSet/SnakeParameters.cxx
Logic/Mesh/AllPurposeProgressAccumulator.cxx
Logic/Mesh/GuidedMeshIO.cxx
Logic/Mesh/IRISMeshPipeline.cxx
Logic/Mesh/LevelSetMeshPipeline.cxx
Logic/Mesh/MeshObject.cxx
Logic/Mesh/MeshOptions.cxx
Logic/Mesh/VTKMeshPipeline.cxx
Logic/Preprocessing/EdgePreprocessingSettings.cxx
Logic/Preprocessing/ThresholdSettings.cxx
Logic/Slicing/IntensityCurveVTK.cxx
)
# The headers for the Logic code
SET(LOGIC_HEADERS
Common/CommandLineArgumentParser.h
Common/Credits.h
Common/IRISException.h
Common/IRISVectorTypes.h
Common/IRISVectorTypes.txx
Common/IRISVectorTypesToITKConversion.h
Common/ITKExtras/itkBSplineScatteredDataPointSetToImageFilter.h
Common/ITKExtras/itkBSplineScatteredDataPointSetToImageFilter.txx
Common/ITKExtras/itkBinaryDiamondStructuringElement.h
Common/ITKExtras/itkBinaryDiamondStructuringElement.txx
Common/ITKExtras/itkCoxDeBoorBSplineKernelFunction.h
Common/ITKExtras/itkCoxDeBoorBSplineKernelFunction.txx
Common/ITKExtras/itkParallelSparseFieldLevelSetImageFilterBugFix.h
Common/ITKExtras/itkParallelSparseFieldLevelSetImageFilterBugFix.txx
Common/ITKExtras/itkTopologyPreservingDigitalSurfaceEvolutionImageFilter.h
Common/ITKExtras/itkTopologyPreservingDigitalSurfaceEvolutionImageFilter.txx
Common/ITKExtras/itkVoxBoCUBImageIO.h
Common/ITKExtras/itkVoxBoCUBImageIOFactory.h
Common/Registry.h
Common/SNAPBorlandDummyTypes.h
Common/SNAPCommon.h
Common/SNAPOpenGL.h
Common/SystemInterface.h
Logic/Common/ColorLabel.h
Logic/Common/ColorLabelTable.h
Logic/Common/ColorMap.h
Logic/Common/ImageCoordinateGeometry.h
Logic/Common/ImageCoordinateTransform.h
Logic/Common/SegmentationStatistics.h
Logic/Common/ImageRayIntersectionFinder.h
Logic/Common/ImageRayIntersectionFinder.txx
Logic/Common/SNAPRegistryIO.h
Logic/Common/SNAPSegmentationROISettings.h
Logic/Framework/GenericImageData.h
Logic/Framework/GlobalState.h
Logic/Framework/IRISApplication.h
Logic/Framework/IRISImageData.h
Logic/Framework/SNAPImageData.h
Logic/Framework/UndoDataManager.h
Logic/Framework/UndoDataManager.txx
Logic/ImageWrapper/GreyImageWrapper.h
Logic/ImageWrapper/ImageIORoutines.h
Logic/ImageWrapper/ImageWrapper.h
Logic/ImageWrapper/ImageWrapper.txx
Logic/ImageWrapper/LabelImageWrapper.h
Logic/ImageWrapper/LabelToRGBAFilter.h
Logic/ImageWrapper/LevelSetImageWrapper.h
Logic/ImageWrapper/RGBImageWrapper.h
Logic/ImageWrapper/ScalarImageWrapper.h
Logic/ImageWrapper/ScalarImageWrapper.txx
Logic/ImageWrapper/SpeedColorMap.h
Logic/ImageWrapper/SpeedImageWrapper.h
Logic/ImageWrapper/VectorImageWrapper.h
Logic/ImageWrapper/VectorImageWrapper.txx
Logic/LevelSet/LevelSetExtensionFilter.h
Logic/LevelSet/SNAPAdvectionFieldImageFilter.h
Logic/LevelSet/SNAPAdvectionFieldImageFilter.txx
Logic/LevelSet/SNAPLevelSetDriver.h
Logic/LevelSet/SNAPLevelSetDriver.txx
Logic/LevelSet/SNAPLevelSetFunction.h
Logic/LevelSet/SNAPLevelSetFunction.txx
Logic/LevelSet/SNAPLevelSetStopAndGoFilter.h
Logic/LevelSet/SNAPLevelSetStopAndGoFilter.txx
Logic/LevelSet/SignedDistanceFilter.h
Logic/LevelSet/SignedDistanceFilter.txx
Logic/LevelSet/SnakeParameters.h
Logic/Mesh/AllPurposeProgressAccumulator.h
Logic/Mesh/GuidedMeshIO.h
Logic/Mesh/IRISMeshPipeline.h
Logic/Mesh/LevelSetMeshPipeline.h
Logic/Mesh/MeshObject.h
Logic/Mesh/MeshOptions.h
Logic/Mesh/VTKMeshPipeline.h
Logic/Preprocessing/EdgePreprocessingImageFilter.h
Logic/Preprocessing/EdgePreprocessingImageFilter.txx
Logic/Preprocessing/EdgePreprocessingSettings.h
Logic/Preprocessing/SmoothBinaryThresholdImageFilter.h
Logic/Preprocessing/SmoothBinaryThresholdImageFilter.txx
Logic/Preprocessing/ThresholdSettings.h
Logic/Slicing/IRISSlicer.h
Logic/Slicing/IRISSlicer.txx
Logic/Slicing/IntensityCurveInterface.h
Logic/Slicing/IntensityCurveVTK.h
Logic/Slicing/UnaryFunctorCache.h
Logic/Slicing/UnaryFunctorCache.txx
)
# These files contain the user interface source code
SET(UI_CXX
UserInterface/BasicComponents/ColorMapBox.cxx
UserInterface/BasicComponents/ColorMapWidget.cxx
UserInterface/BasicComponents/FLTKCanvas.cxx
UserInterface/BasicComponents/FunctionPlot2DBox.cxx
UserInterface/BasicComponents/FunctionPlot2D.cxx
UserInterface/BasicComponents/IntensityCurveBox.cxx
UserInterface/BasicComponents/InteractionModeClient.cxx
UserInterface/BasicComponents/MetaDataTable.cxx
UserInterface/BasicComponents/RecursiveInteractionMode.cxx
UserInterface/BasicComponents/SnakeParametersPreviewBox.cxx
UserInterface/BasicComponents/SnakeParametersPreviewPipeline.cxx
UserInterface/BasicComponents/StatisticsTable.cxx
UserInterface/Common/SNAPAppearanceSettings.cxx
UserInterface/ImageIOWizard/ImageIOWizardLogic.cxx
UserInterface/ImageIOWizard/RestrictedImageIOWizardLogic.cxx
UserInterface/MainComponents/AppearanceDialogUILogic.cxx
UserInterface/MainComponents/HelpViewerLogic.cxx
UserInterface/MainComponents/LabelEditorUILogic.cxx
UserInterface/MainComponents/LayerInspectorUILogic.cxx
UserInterface/MainComponents/PreprocessingUILogic.cxx
UserInterface/MainComponents/ReorientImageUILogic.cxx
UserInterface/MainComponents/ResizeRegionDialogLogic.cxx
UserInterface/MainComponents/RestoreSettingsDialogLogic.cxx
UserInterface/MainComponents/SimpleFileDialogLogic.cxx
UserInterface/MainComponents/SnakeParametersUILogic.cxx
UserInterface/MainComponents/UserInterfaceLogic.cxx
UserInterface/MeshIOWizard/MeshIOWizardUILogic.cxx
UserInterface/SliceWindow/AnnotationInteractionMode.cxx
UserInterface/SliceWindow/BubblesInteractionMode.cxx
UserInterface/SliceWindow/CrosshairsInteractionMode.cxx
UserInterface/SliceWindow/GenericSliceWindow.cxx
UserInterface/SliceWindow/IRISSliceWindow.cxx
UserInterface/SliceWindow/GLToPNG.cxx
UserInterface/SliceWindow/OpenGLSliceTexture.cxx
UserInterface/SliceWindow/PaintbrushInteractionMode.cxx
UserInterface/SliceWindow/PolygonDrawing.cxx
UserInterface/SliceWindow/PolygonInteractionMode.cxx
UserInterface/SliceWindow/PolygonScanConvert.cxx
UserInterface/SliceWindow/PopupButtonInteractionMode.cxx
UserInterface/SliceWindow/RegionInteractionMode.cxx
UserInterface/SliceWindow/SNAPSliceWindow.cxx
UserInterface/SliceWindow/SliceWindowCoordinator.cxx
UserInterface/SliceWindow/ThumbnailInteractionMode.cxx
UserInterface/Window3D/Trackball.cxx
UserInterface/Window3D/Window3D.cxx
)
# The header files for the UI project
SET(UI_HEADERS
UserInterface/BasicComponents/ColorMapBox.h
UserInterface/BasicComponents/ColorMapWidget.h
UserInterface/BasicComponents/FLTKCanvas.h
UserInterface/BasicComponents/FLTKEvent.h
UserInterface/BasicComponents/FLTKWidgetActivationManager.h
UserInterface/BasicComponents/FunctionPlot2D.h
UserInterface/BasicComponents/FunctionPlot2DBox.h
UserInterface/BasicComponents/IntensityCurveBox.h
UserInterface/BasicComponents/InteractionMode.h
UserInterface/BasicComponents/InteractionModeClient.h
UserInterface/BasicComponents/MetaDataTable.h
UserInterface/BasicComponents/RecursiveInteractionMode.h
UserInterface/BasicComponents/SnakeParametersPreviewBox.h
UserInterface/BasicComponents/SnakeParametersPreviewPipeline.h
UserInterface/BasicComponents/StatisticsTable.h
UserInterface/Common/SNAPAppearanceSettings.h
UserInterface/Common/SNAPCommonUI.h
UserInterface/ImageIOWizard/ImageIOWizardBase.h
UserInterface/ImageIOWizard/ImageIOWizardLogic.h
UserInterface/ImageIOWizard/RestrictedImageIOWizardLogic.h
UserInterface/MainComponents/AppearanceDialogUIBase.h
UserInterface/MainComponents/AppearanceDialogUILogic.h
UserInterface/MainComponents/HelpViewerBase.h
UserInterface/MainComponents/HelpViewerLogic.h
UserInterface/MainComponents/LabelEditorUIBase.h
UserInterface/MainComponents/LabelEditorUILogic.h
UserInterface/MainComponents/LayerInspectorUIBase.h
UserInterface/MainComponents/LayerInspectorUILogic.h
UserInterface/MainComponents/PreprocessingUIBase.h
UserInterface/MainComponents/PreprocessingUILogic.h
UserInterface/MainComponents/ReorientImageUIBase.h
UserInterface/MainComponents/ReorientImageUILogic.h
UserInterface/MainComponents/ResizeRegionDialogBase.h
UserInterface/MainComponents/ResizeRegionDialogLogic.h
UserInterface/MainComponents/RestoreSettingsDialogBase.h
UserInterface/MainComponents/RestoreSettingsDialogLogic.h
UserInterface/MainComponents/SimpleFileDialogBase.h
UserInterface/MainComponents/SimpleFileDialogLogic.h
UserInterface/MainComponents/SnakeParametersUIBase.h
UserInterface/MainComponents/SnakeParametersUILogic.h
UserInterface/MainComponents/UserInterfaceBase.h
UserInterface/MainComponents/UserInterfaceLogic.h
UserInterface/MeshIOWizard/MeshExportSettings.h
UserInterface/MeshIOWizard/MeshIOWizardUIBase.h
UserInterface/MeshIOWizard/MeshIOWizardUILogic.h
UserInterface/SliceWindow/AnnotationInteractionMode.h
UserInterface/SliceWindow/BubblesInteractionMode.h
UserInterface/SliceWindow/CrosshairsInteractionMode.h
UserInterface/SliceWindow/GLToPNG.h
UserInterface/SliceWindow/GenericSliceWindow.h
UserInterface/SliceWindow/IRISSliceWindow.h
UserInterface/SliceWindow/OpenGLSliceTexture.h
UserInterface/SliceWindow/PaintbrushInteractionMode.h
UserInterface/SliceWindow/PolygonDrawing.h
UserInterface/SliceWindow/PolygonInteractionMode.h
UserInterface/SliceWindow/PolygonScanConvert.h
UserInterface/SliceWindow/PopupButtonInteractionMode.h
UserInterface/SliceWindow/RegionInteractionMode.h
UserInterface/SliceWindow/SNAPSliceWindow.h
UserInterface/SliceWindow/SliceWindowCoordinator.h
UserInterface/SliceWindow/ThumbnailInteractionMode.h
UserInterface/Window3D/Trackball.h
UserInterface/Window3D/Window3D.h
)
# The source code for SNAP testing project
SET(TESTING_CXX
Testing/TestMain.cxx
Testing/SNAPTestDriver.cxx
)
# The source code for the tutorial test
SET(TESTING_TUTORIAL_CXX
Testing/TutorialTest.cxx
)
# The headers for the testing code
SET(TESTING_HEADERS
Testing/SNAPTestDriver.h
Testing/TestBase.h
Testing/TestCompareLevelSets.h
Testing/TestImageWrapper.h
)
# The FL files for SNAP
SET(APPLICATION_FLUIDS
UserInterface/ImageIOWizard/ImageIOWizard.fl
UserInterface/MeshIOWizard/MeshIOWizardUI.fl
UserInterface/MainComponents/AppearanceDialogUI.fl
UserInterface/MainComponents/HelpViewer.fl
UserInterface/MainComponents/LabelEditorUI.fl
UserInterface/MainComponents/LayerInspectorUI.fl
UserInterface/MainComponents/PreprocessingUI.fl
UserInterface/MainComponents/ReorientImageUI.fl
UserInterface/MainComponents/ResizeRegionDialog.fl
UserInterface/MainComponents/RestoreSettingsDialog.fl
UserInterface/MainComponents/SimpleFileDialog.fl
UserInterface/MainComponents/SnakeParametersUI.fl
UserInterface/MainComponents/UserInterface.fl
)
#############################################
# LIBRARIES AND EXTERNAL CODE #
#############################################
# Due to a limitation in Visual studio 6.0 on the length of include directories
# that can be specified, (here we are including all the include directories from
# ITK, VTK, FLTK and SNAP), if the compiler is VS6, we copy the SNAP source files
# to a single path in the binary tree to cut down on the number of
# INCLUDE_DIRECTORIES
IF( CMAKE_GENERATOR MATCHES "Visual Studio 6" )
FILE( GLOB_RECURSE SNAP_GLOBBED_CXX "${SNAP_SOURCE_DIR}/*.cxx" )
FILE( GLOB_RECURSE SNAP_GLOBBED_H "${SNAP_SOURCE_DIR}/*.h" )
FILE( GLOB_RECURSE SNAP_GLOBBED_TXX "${SNAP_SOURCE_DIR}/*.txx" )
SET( SNAP_SOURCES
${SNAP_GLOBBED_CXX}
${SNAP_GLOBBED_H}
${SNAP_GLOBBED_TXX}
)
MAKE_DIRECTORY( "${SNAP_BINARY_DIR}/src" )
SET( CONFIGURED_SOURCE_DIRECTORY "${SNAP_BINARY_DIR}/src" )
FOREACH( SourceFile ${SNAP_SOURCES} )
GET_FILENAME_COMPONENT( CONFIGURED_SOURCE_FILE ${SourceFile} NAME )
SET( CONFIGURED_SOURCE_FILE "${CONFIGURED_SOURCE_DIRECTORY}/${CONFIGURED_SOURCE_FILE}" )
CONFIGURE_FILE( ${SourceFile} ${CONFIGURED_SOURCE_FILE}
COPYONLY IMMEDIATE )
ENDFOREACH( SourceFile )
INCLUDE_DIRECTORIES(
${CONFIGURED_SOURCE_DIRECTORY}
${ITK_DIR}/Utilities/zlib
${SNAP_BINARY_DIR}/UserInterface/ImageIOWizard
${SNAP_BINARY_DIR}/UserInterface/MainComponents
${FLTK_INCLUDE_PATH}
${OPENGL_INCLUDE_PATH}
)
ELSE( CMAKE_GENERATOR MATCHES "Visual Studio 6" )
# Include directories
INCLUDE_DIRECTORIES(
${ITK_DIR}/Utilities/zlib
${SNAP_SOURCE_DIR}/Common
${SNAP_SOURCE_DIR}/Common/ITKExtras
${SNAP_SOURCE_DIR}/Logic
${SNAP_SOURCE_DIR}/Logic/Common
${SNAP_SOURCE_DIR}/Logic/Framework
${SNAP_SOURCE_DIR}/Logic/ImageWrapper
${SNAP_SOURCE_DIR}/Logic/LevelSet
${SNAP_SOURCE_DIR}/Logic/Mesh
${SNAP_SOURCE_DIR}/Logic/Preprocessing
${SNAP_SOURCE_DIR}/Logic/Slicing
${SNAP_SOURCE_DIR}/Testing
${SNAP_SOURCE_DIR}/UserInterface/BasicComponents
${SNAP_SOURCE_DIR}/UserInterface/Common
${SNAP_SOURCE_DIR}/UserInterface/ImageIOWizard
${SNAP_SOURCE_DIR}/UserInterface/MeshIOWizard
${SNAP_SOURCE_DIR}/UserInterface/MainComponents
${SNAP_SOURCE_DIR}/UserInterface/MainComponents/Artwork
${SNAP_SOURCE_DIR}/UserInterface/SliceWindow
${SNAP_SOURCE_DIR}/UserInterface/Window3D
${SNAP_BINARY_DIR}/UserInterface/ImageIOWizard
${SNAP_BINARY_DIR}/UserInterface/MainComponents
${FLTK_INCLUDE_PATH}
${OPENGL_INCLUDE_PATH}
)
ENDIF( CMAKE_GENERATOR MATCHES "Visual Studio 6" )
# Get rid of this ridiculous warning in VS8
IF( CMAKE_GENERATOR MATCHES "Visual Studio 8" OR CMAKE_GENERATOR MATCHES "Visual Studio 9")
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ENDIF( CMAKE_GENERATOR MATCHES "Visual Studio 8" OR CMAKE_GENERATOR MATCHES "Visual Studio 9")
# ----------------------------------------------------------------
# Define External Libraries
# ----------------------------------------------------------------
# ITK Libraries
SET(SNAP_ITK_LIBS
ITKIO
)
# Core VTK libraries
SET(SNAP_VTK_CORE_LIBS
vtkCommon
vtkRendering
vtkFiltering
vtkGraphics
vtkImaging
vtkIO
)
# VTK Libraries with possible inclusion of patented code
IF(VTK_USE_PATENTED)
SET(SNAP_VTK_LIBS vtkPatented ${SNAP_VTK_CORE_LIBS})
ELSE(VTK_USE_PATENTED)
SET(SNAP_VTK_LIBS ${SNAP_VTK_CORE_LIBS})
ENDIF(VTK_USE_PATENTED)
# FLTK Related libraries
SET(SNAP_FLTK_LIBS ${FLTK_LIBRARIES})
# System libraries
SET(SNAP_SYSTEM_LIBS
${OPENGL_LIBRARIES}
${OPENGL_glu_LIBRARY}
${SYSTEM_LIBS}
)
# Designate the external libraries used by SNAP
SET(SNAP_EXTERNAL_LIBS
${SNAP_FLTK_LIBS}
${SNAP_ITK_LIBS}
${SNAP_VTK_LIBS}
${SNAP_SYSTEM_LIBS})
# *****************************************************
# SNAP Logic and UI Libraries
# *****************************************************
# Wrap the .fl files
FLTK_WRAP_UI(itksnapui ${APPLICATION_FLUIDS})
# The SNAP logic library
ADD_LIBRARY(itksnaplogic ${LOGIC_CXX} ${LOGIC_HEADERS})
# The user interface code library
ADD_LIBRARY(itksnapui ${UI_CXX} ${UI_HEADERS} ${itksnapui_FLTK_UI_SRCS})
# This is experimental: it seems that shared libraries do not
# build accurately (at least on MacOS) without the following
# two lines
TARGET_LINK_LIBRARIES(itksnaplogic ${SNAP_EXTERNAL_LIBS})
TARGET_LINK_LIBRARIES(itksnapui itksnaplogic ${SNAP_EXTERNAL_LIBS})
# Designate the SNAP internal libraries
SET(SNAP_INTERNAL_LIBS itksnapui itksnaplogic)
# *****************************************************
# Define SNAP Executables
# *****************************************************
SET(SNAP_EXE InsightSNAP)
# Disable FLTK warnings
#ITK_DISABLE_FLTK_GENERATED_WARNINGS("${APPLICATION_FLUIDS}")
# Define the main SNAP executable
ADD_EXECUTABLE(${SNAP_EXE} WIN32 UserInterface/SNAPMain.cxx)
TARGET_LINK_LIBRARIES(${SNAP_EXE}
${SNAP_INTERNAL_LIBS}
${SNAP_EXTERNAL_LIBS}
)
# Define the testing EXE
ADD_EXECUTABLE(snaptest ${TESTING_CXX})
TARGET_LINK_LIBRARIES(snaptest
${SNAP_INTERNAL_LIBS}
${SNAP_EXTERNAL_LIBS})
# ----------------------------------------------------------------
# Miscelaneous tasks (not related to link and compilation)
# ----------------------------------------------------------------
# All program files - use recursive globbing
FILE(GLOB_RECURSE PROGRAM_DATA_FILES ProgramData "*.txt" "*.html" "*.gif" "*.png" "*.img.gz" "*.hdr")
# Copy documentation from the source tree to the build tree
FOREACH(DATAFILE ${PROGRAM_DATA_FILES})
FILE(RELATIVE_PATH SHORTNAME ${SNAP_SOURCE_DIR} ${DATAFILE})
CONFIGURE_FILE(
${SNAP_SOURCE_DIR}/${SHORTNAME}
${SNAP_BINARY_DIR}/${SHORTNAME}
COPYONLY)
ENDFOREACH(DATAFILE)
#########################################################
# INSTALLATION AND PACKAGING with CPack #
#########################################################
INCLUDE(CMake/CustomBuildSettings.cmake)
# Generate forward shared executable
SUBDIRS(Utilities/Forwarding)
# Install the SNAP executable in the appropriate place.
# Windows (Microsoft Visual Studio)
IF(WIN32 AND NOT UNIX)
INSTALL(TARGETS ${SNAP_EXE} RUNTIME DESTINATION bin)
SET(SNAP_DATA_INSTALL_DIR ".")
ENDIF(WIN32 AND NOT UNIX)
# Apple
IF(APPLE)
# Copy executable into the bundle
SET(SNAP_MAIN_INSTALL_DIR ITK-SNAP.app/Contents/MacOS)
SET(SNAP_DATA_INSTALL_DIR ${SNAP_MAIN_INSTALL_DIR})
INSTALL(TARGETS ${SNAP_EXE} RUNTIME DESTINATION ${SNAP_MAIN_INSTALL_DIR})
# Configure the XML file
CONFIGURE_FILE(
${SNAP_SOURCE_DIR}/Utilities/MacOS/BundleResources/Info.plist
${SNAP_BINARY_DIR}/Utilities/MacOS/BundleResources/Info.plist)
INSTALL(FILES ${SNAP_BINARY_DIR}/Utilities/MacOS/BundleResources/Info.plist
DESTINATION ITK-SNAP.app/Contents)
INSTALL(FILES ${SNAP_SOURCE_DIR}/Utilities/MacOS/BundleResources/itksnap.icns
DESTINATION ITK-SNAP.app/Contents/Resources)
ENDIF(APPLE)
# Other UNIX
IF(UNIX AND NOT APPLE)
SET(SNAP_MAIN_INSTALL_DIR lib/snap-${SNAP_VERSION_FULL})
SET(SNAP_DATA_INSTALL_DIR ${SNAP_MAIN_INSTALL_DIR})
INSTALL(TARGETS ${SNAP_EXE} RUNTIME DESTINATION ${SNAP_MAIN_INSTALL_DIR})
ENDIF(UNIX AND NOT APPLE)
# Install the Program Data files
INSTALL(DIRECTORY ${SNAP_BINARY_DIR}/ProgramData DESTINATION ${SNAP_DATA_INSTALL_DIR})
# On Win32, we must include the redistributable
IF(MSVC80 OR MSVC90)
FIND_PROGRAM(VCREDIST_EXE vcredist_x86.exe vcredist_x64.exe)
IF(VCREDIST_EXE)
GET_FILENAME_COMPONENT(VCREDIST_NAME ${VCREDIST_EXE} NAME)
INSTALL(FILES ${VCREDIST_EXE} DESTINATION bin)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"ExecWait '\\\"$INSTDIR\\\\bin\\\\${VCREDIST_NAME}\\\" /q:a'")
ENDIF(VCREDIST_EXE)
ENDIF(MSVC80 OR MSVC90)
# Allow package generation
SET(CPACK_PACKAGE_NAME "itksnap")
SET(CPACK_PACKAGE_CONTACT "Paul A. Yushkevich")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ITK-SNAP 3D Image Segmentation Tool")
SET(CPACK_PACKAGE_VENDOR "itksnap.org")
SET(CPACK_PACKAGE_VERSION_MAJOR "${SNAP_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${SNAP_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${SNAP_VERSION_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "itksnap-${SNAP_VERSION_FULL}")
# Show GPL license
SET(CPACK_RESOURCE_FILE_LICENSE "${SNAP_SOURCE_DIR}/COPYING")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "InsightSNAP.exe")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ITK-SNAP")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.itksnap.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.itksnap.org/credits.php")
SET(CPACK_NSIS_MODIFY_PATH OFF)
# Give it a windowsy directory name
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "ITK-SNAP ${SNAP_VERSION_MAJOR}.${SNAP_VERSION_MINOR}")
# On Win32, the executable is the actual exe
SET(CPACK_PACKAGE_EXECUTABLES InsightSNAP "ITK-SNAP")
ELSE(WIN32 AND NOT UNIX)
# Set the generator to either STGZ or Apple
IF(NOT APPLE)
SET(CPACK_GENERATOR "TGZ")
ELSE(NOT APPLE)
SET(CPACK_GENERATOR "ZIP")
ENDIF(NOT APPLE)
# Executable is the forward sharing exe
SET(CPACK_PACKAGE_EXECUTABLES "itksnap" "ITK-SNAP")
ENDIF(WIN32 AND NOT UNIX)
# Figure out the extension of the binary
MESSAGE(STATUS "Generator: ${CPACK_GENERATOR}")
IF(CPACK_GENERATOR STREQUAL "NSIS")
SET(CPACK_EXTENSION "exe")
ELSEIF(CPACK_GENERATOR STREQUAL "ZIP")
SET(CPACK_EXTENSION "zip")
ELSEIF(CPACK_GENERATOR STREQUAL "TGZ")
SET(CPACK_EXTENSION "tar.gz")
ENDIF(CPACK_GENERATOR STREQUAL "NSIS")
# The filename of the installable package
SET(CPACK_TARGET_FILENAME ${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}.${CPACK_EXTENSION})
SET(CPACK_TARGET ${SNAP_BINARY_DIR}/${CPACK_TARGET_FILENAME})
# Call CPACK
INCLUDE(CPack)
INCLUDE(CTest)
#########################################################
# Automatic Uploading of Nightly Packages #
#########################################################
FIND_PROGRAM(SCP_PROGRAM NAMES scp DOC "Location of the scp program (optional)")
MARK_AS_ADVANCED(SCP_PROGRAM)
SET(SCP_ARGUMENTS "-v" CACHE STRING "Optional arguments to the scp command for uploads to SourceForge")
MARK_AS_ADVANCED(SCP_ARGUMENTS)
SET(SCP_USERNAME "" CACHE STRING "SourceForge.net account id for uploads")
MARK_AS_ADVANCED(SCP_USERNAME)
SET(NIGHTLY_TARGET "itksnap-nightly-${CPACK_SYSTEM_NAME}.${CPACK_EXTENSION}")
SET(SCP_ROOT "frs.sourceforge.net:/home/frs/project/i/it/itk-snap/itk-snap")
ADD_CUSTOM_TARGET(upload_nightly
VERBATIM COMMAND "${SCP_PROGRAM}" ${SCP_ARGUMENTS} ${CPACK_TARGET_FILENAME} ${SCP_USERNAME},itk-snap@${SCP_ROOT}/Nightly/${NIGHTLY_TARGET}
DEPENDS ${CPACK_TARGET}
WORKING_DIRECTORY ${SNAP_BINARY_DIR}
COMMENT "Uploading package ${CPACK_TARGET} to SourceForge.net as ${NIGHTLY_TARGET}")
ADD_CUSTOM_TARGET(upload_experimental
VERBATIM COMMAND "${SCP_PROGRAM}" ${SCP_ARGUMENTS} ${CPACK_TARGET_FILENAME} ${SCP_USERNAME},itk-snap@${SCP_ROOT}/Experimental
DEPENDS ${CPACK_TARGET}
WORKING_DIRECTORY ${SNAP_BINARY_DIR}
COMMENT "Uploading package ${CPACK_TARGET} to SourceForge.net to Experimental directory")
itksnap/Common/ 0000755 0000765 0000024 00000000000 11560342170 012773 5 ustar pauly staff itksnap/Common/CommandLineArgumentParser.cxx 0000644 0000765 0000024 00000011004 11115053275 020562 0 ustar pauly staff /*=========================================================================
Program: ITK-SNAP
Module: $RCSfile: CommandLineArgumentParser.cxx,v $
Language: C++
Date: $Date: 2008/12/01 21:27:25 $
Version: $Revision: 1.4 $
Copyright (c) 2007 Paul A. Yushkevich
This file is part of ITK-SNAP
ITK-SNAP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
-----
Copyright (c) 2003 Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "CommandLineArgumentParser.h"
#include
#include
using namespace std;
void
CommandLineArgumentParser
::AddOption(const char *name, int nParameters)
{
// Create a structure for the command
OptionType option;
option.CommonName = string(name);
option.NumberOfParameters = nParameters;
// Add the option to the map
m_OptionMap[string(name)] = option;
}
void
CommandLineArgumentParser
::AddSynonim(const char *option, const char *synonim)
{
string strOption(option);
string strSynonim(synonim);
// The option should exist!
assert(m_OptionMap.find(strOption) != m_OptionMap.end());
// Create a new option object
OptionType o;
o.NumberOfParameters = m_OptionMap[strOption].NumberOfParameters;
o.CommonName = strOption;
// Insert the option into the map
m_OptionMap[strSynonim] = o;
}
bool
CommandLineArgumentParser
::TryParseCommandLine(int argc, char *argv[],
CommandLineArgumentParseResult &outResult,
bool failOnUnknownTrailingParameters, int &argc_out)
{
// Clear the result
outResult.Clear();
// Go through the arguments
for(argc_out=1; argc_out < argc; argc_out++)
{
// Get the next argument
string arg(argv[argc_out]);
// Check if the argument is known
if(m_OptionMap.find(arg) == m_OptionMap.end())
{
if(failOnUnknownTrailingParameters)
{
// Unknown argument found
cerr << "Unrecognized command line option '" << arg << "'" << endl;
return false;
}
else if(arg[0] == '-')
{
cerr << "Ignoring unknown command line option '" << arg << "'" << endl;
continue;
}
else
{
return true;
}
}
// Check if the number of parameters is correct
int nParameters = m_OptionMap[arg].NumberOfParameters;
if(argc_out+nParameters >= argc)
{
// Too few parameters
cerr << "Too few parameters to command line option '" << arg
<< "'" << endl;
return false;
}
// Tell the result that the option has been encountered
outResult.AddOption(m_OptionMap[arg].CommonName,nParameters);
// Pass in the parameters
for(int j=0;j