X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FCMakeLists.txt;h=fe6120ec7e47c80058f5de72391c75d19ed10e12;hb=768d2a323265bc8f800fadea925ab9f3a0f8cf24;hp=0780ef82c1b8e75e2b2a18af7f84c20f2c639e3d;hpb=af096ff87ff2196adae5e1ca9f55f1fbbbb1f2d2;p=clitk.git diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 0780ef8..fe6120e 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -4,238 +4,414 @@ cmake_minimum_required(VERSION 2.4) # To avoid warning with some version if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0007 NEW) endif(COMMAND cmake_policy) #========================================================= +OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF) +#========================================================= + +# Look for OpenGL2 version +if (VTK_RENDERING_BACKEND STREQUAL "OpenGL2") + add_definitions(-DVTK_OPENGL2) +endif () + +#List of vv tools to compile +set(vv_TOOLS + vvToolMedianFilter + vvToolRigidReg + vvToolCropImage + vvToolBinarize + vvToolImageArithm + vvToolMIP + vvToolConvert ## with dummy vvToolConvert.ui + vvToolROIManager + vvToolSegmentation + vvToolProfile + vvToolHistogram + ## these ones are for tests (not working) + # vvToolTest + # vvToolFoo + # vvToolFooWithWidgetBase + # vvToolPlastimatch + # vvToolConnectedComponentLabeling + ## these ones are old ones + # vvToolExtractPatient + # vvToolExtractLung + # vvToolStructureSetManager +) +# dependencies of the tools +# Future issues : when tool depend on other tools ... how to manage that ? +# >> add the relevant $_LIBS variable to the tool that has dependencies? +set(vvToolBinarize_LIBS clitkBinarizeImageLib) +set(vvToolProfile_LIBS clitkProfileImageLib) +set(vvToolHistogram_LIBS clitkHistogramImageLib) +set(vvToolConvert_LIBS clitkImageConvertLib) +set(vvToolExtractPatient_LIBS clitkSegmentationGgoLib) +set(vvToolExtractLung_LIBS clitkSegmentationGgoLib) +set(vvToolCropImage_LIBS clitkCropImageLib) +set(vvToolMIP_LIBS clitkMIPLib) +set(vvToolMedianFilter_LIBS clitkMedianImageFilterLib) +set(vvToolImageArithm_LIBS clitkImageArithmImageLib) +set(vvToolROIManager_LIBS clitkDicomRTStruct) #========================================================= # List of vv source files -SET(vv_SRCS - vvInfoPanel.cxx - vvLinkPanel.cxx - vvOverlayPanel.cxx - vvLandmarksPanel.cxx + +# in COMMON_WITH_UI -> must have .h and .cxx and .ui +set(vv_COMMON_WITH_UI + vvInfoPanel + vvMainWindow + vvLinkPanel + vvOverlayPanel + vvLandmarksPanel + vvProgressDialog + vvSegmentationDialog + vvSurfaceViewerDialog + vvDeformationDialog + vvStructSelector + vvIntensityValueSlider + vvLabelImageLoaderWidget + vvToolWidgetBase + vvToolSimpleInputSelectorWidget + vvToolInputSelectorWidget + vvRegisterForm +) + +# All others sources +set(vv_SRCS vvQProgressDialogITKCommand.cxx vvQDicomSeriesSelector.cxx QTreePushButton.cxx - vvSegmentationDialog.cxx - vvSurfaceViewerDialog.cxx vvMainWindowBase.cxx - vvMainWindow.cxx - vvDeformationDialog.cxx vvImageWarp.cxx vvDeformableRegistration.cxx vtkVOXImageWriter.cxx vvInteractorStyleNavigator.cxx vvSlicer.cxx - vvImageReader.cxx - vvImageReader.txx - vvImageWriter.cxx - vvImageWriter.txx vvLandmarks.cxx vvLandmarksGlyph.cxx + vvClipPolyData.cxx vvGlyphSource.cxx vvGlyph2D.cxx vvSlicerManager.cxx vvSlicerManagerCommand.cxx + vvToolHistogramCommand.cxx vvUtils.cxx - vvMaximumIntensityProjection.cxx - vvMesh.cxx +# vvMaximumIntensityProjection.cxx + vvMesh.cxx vvMeshActor.cxx vvMeshReader.cxx - vvStructSelector.cxx vvMidPosition.cxx - vvImageMapToWLColors.cxx - vvIntensityValueSlider.cxx - vvToolManager.cxx - vvToolCreatorBase.cxx - vvToolWidgetBase.cxx - vvToolMedianFilter.cxx - vvToolRigidReg.cxx -# vvToolFoo.cxx -# vvToolFooWithWidgetBase.cxx - vvToolCropImage.cxx - vvToolBinarize.cxx - vvToolSimpleInputSelectorWidget.cxx - vvToolInputSelectorWidget.cxx vvImageContour.cxx vvBinaryImageOverlayActor.cxx - vvToolImageArithm.cxx - vvToolConvert.cxx - vvToolStructureSetManager.cxx vvStructureSetActor.cxx + vvSaveState.cxx + vvReadState.cxx vvROIActor.cxx - vvToolResample.cxx vvBlendImageActor.cxx - ) -#========================================================= + vvToolManager.cxx + vvToolCreatorBase.cxx + vvToolBaseBase.cxx +) #========================================================= # Qt related commands -FIND_PACKAGE(Qt4 REQUIRED) - -QT4_WRAP_CPP(vv_SRCS - vvMainWindowBase.h - vvMainWindow.h - QTreePushButton.h - vvInfoPanel.h - vvLinkPanel.h - vvOverlayPanel.h - vvLandmarksPanel.h - vvDocumentation.h - vvHelpDialog.h - vvProgressDialog.h - vvQDicomSeriesSelector.h - vvSegmentationDialog.h - vvSurfaceViewerDialog.h - vvDeformationDialog.h - vvSlicerManager.h - vvStructSelector.h - vvIntensityValueSlider.h - vvToolCreatorBase.h -# vvToolFoo.h -# vvToolFooWithWidgetBase.h - vvToolMedianFilter.h - vvToolRigidReg.h - vvToolBinarize.h - vvToolSimpleInputSelectorWidget.h - vvToolInputSelectorWidget.h - vvToolWidgetBase.h - vvToolCropImage.h - vvToolImageArithm.h - vvToolConvert.h - vvToolStructureSetManager.h - vvStructureSetActor.h - vvROIActor.h - vvToolResample.h - ) +if(vv_QT_VERSION VERSION_GREATER "4") + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Network REQUIRED) + find_package(Qt5Designer REQUIRED) +else() + find_package(Qt4 REQUIRED) +endif() -QT4_WRAP_UI(vv_UI_CXX - qt_ui/vvMainWindow.ui - qt_ui/vvInfoPanel.ui - qt_ui/vvLinkPanel.ui - qt_ui/vvOverlayPanel.ui - qt_ui/vvLandmarksPanel.ui - qt_ui/vvHelpDialog.ui - qt_ui/vvDocumentation.ui - qt_ui/vvProgressDialog.ui - qt_ui/vvDicomSeriesSelector.ui - qt_ui/vvSegmentationDialog.ui - qt_ui/vvSurfaceViewerDialog.ui - qt_ui/vvDeformationDialog.ui - qt_ui/vvStructSelector.ui - qt_ui/vvDummyWindow.ui #For testing - qt_ui/vvIntensityValueSlider.ui - qt_ui/vvToolSimpleInputSelectorWidget.ui - qt_ui/vvToolInputSelectorWidget.ui - qt_ui/vvToolWidgetBase.ui - qt_ui/vvToolMedianFilter.ui - qt_ui/vvToolRigidReg.ui -# qt_ui/vvToolFoo.ui - qt_ui/vvToolCropImage.ui - qt_ui/vvToolBinarize.ui - qt_ui/vvToolImageArithm.ui - qt_ui/vvToolStructureSetManager.ui - qt_ui/vvToolResample.ui - ) +if(vv_QT_VERSION VERSION_GREATER "4") + link_directories(${QT5Widgets_LIBRARIES}) + link_directories(${QT5Network_LIBRARIES}) + link_directories(${QT5Designer_LIBRARIES}) +else() + link_directories(${QT_LIBRARY_DIR}) +endif() -QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc) +if(vv_QT_VERSION VERSION_GREATER "4") + qt5_wrap_cpp(vv_SRCS + vvMainWindowBase.h + QTreePushButton.h + vvDocumentation.h + vvHelpDialog.h + vvQDicomSeriesSelector.h + vvSlicerManager.h + vvSlicer.h + vvStructureSetActor.h + vvROIActor.h + vvToolCreatorBase.h + ) +else() + QT4_WRAP_CPP(vv_SRCS + vvMainWindowBase.h + QTreePushButton.h + vvDocumentation.h + vvHelpDialog.h + vvQDicomSeriesSelector.h + vvSlicerManager.h + vvSlicer.h + vvStructureSetActor.h + vvROIActor.h + vvToolCreatorBase.h + ) +endif() -ADD_DEFINITIONS(-DQT_DLL) -ADD_DEFINITIONS(-DQT_THREAD_SUPPORT) +if(vv_QT_VERSION VERSION_GREATER "4") + qt5_wrap_ui(vv_UI_CXX + qt_ui/vvHelpDialog.ui + qt_ui/vvDocumentation.ui + qt_ui/vvDicomSeriesSelector.ui + qt_ui/vvDummyWindow.ui #For testing + ) +else() + QT4_WRAP_UI(vv_UI_CXX + qt_ui/vvHelpDialog.ui + qt_ui/vvDocumentation.ui + qt_ui/vvDicomSeriesSelector.ui + qt_ui/vvDummyWindow.ui #For testing + ) +endif() -INCLUDE_DIRECTORIES( - ${QT_INCLUDES} - ${QT_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} -) +if(vv_QT_VERSION VERSION_GREATER "4") + QT5_add_resources(vv_SRCS vvIcons.qrc) +else() + QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc) +endif() + +# Add DICOM SERVER gui selector if the adequate GDCM is available +if(CLITK_USE_PACS_CONNECTION) + SET(vv_SRCS ${vv_SRCS} + vvQPacsConnection.cxx + vvPacsSettingsDialog.cxx + vvDicomServerQueryFactory.cxx + ) + if(vv_QT_VERSION VERSION_GREATER "4") + qt5_wrap_cpp(vv_SRCS vvQPacsConnection.h + vvPacsSettingsDialog.h) + qt5_wrap_ui(vv_UI_CXX + qt_ui/vvPacsConnection.ui + qt_ui/vvPacsSettingsDialog.ui) + else() + QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h + vvPacsSettingsDialog.h) + QT4_WRAP_UI(vv_UI_CXX + qt_ui/vvPacsConnection.ui + qt_ui/vvPacsSettingsDialog.ui) + endif() +endif(CLITK_USE_PACS_CONNECTION) + + # Add the autotools in the header vvToolsList.h for initialization of the dummy + # variables in vv.cxx for the tools contained in vvLib + if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h) + file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h) + foreach(tool ${vv_TOOLS}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n") + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n") + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n") + endforeach(tool) + endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h) + + # Add the autotools and the common files ui + foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI}) + set(vv_SRCS ${vv_SRCS} ${tool}.cxx) + if(vv_QT_VERSION VERSION_GREATER "4") + QT5_WRAP_CPP(vv_SRCS ${tool}.h) + QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) + else() + QT4_WRAP_CPP(vv_SRCS ${tool}.h) + QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) + endif() + endforeach(tool) + + # Add the common source files + foreach(tool ${vv_COMMON}) + set(vv_SRCS ${vv_SRCS} ${tool}.cxx) + if(vv_QT_VERSION VERSION_GREATER "4") + QT5_WRAP_CPP(vv_SRCS ${tool}.h) + else() + QT4_WRAP_CPP(vv_SRCS ${tool}.h) + endif() + endforeach(tool) + + # if Windows and Qt was built as a static lib then don't set QT_DLL flag + set(QT_STATIC 0) + if(WIN32) + if(vv_QT_VERSION VERSION_GREATER "4") + if(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl) + file(READ ${Qt5Widgets_LIBRARIES}/QtCore.prl QT_CORE_PRL) + if(${QT_CORE_PRL} MATCHES "static") + set(QT_STATIC 1) + endif(${QT_CORE_PRL} MATCHES "static") + endif(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl) + else() + if(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl) + file(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL) + if(${QT_CORE_PRL} MATCHES "static") + set(QT_STATIC 1) + endif(${QT_CORE_PRL} MATCHES "static") + endif(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl) + endif() + endif(WIN32) + if(NOT QT_STATIC) + add_definitions(-DQT_DLL) + endif(NOT QT_STATIC) + + add_definitions(-DQT_THREAD_SUPPORT) + if(vv_QT_VERSION VERSION_GREATER "4") + include_directories( + ${Qt5Widgets_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${Qt5Designer_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ) + else() + include_directories( + ${QT_INCLUDES} + ${QT_INCLUDE_DIR} + ${QT_QTGUI_INCLUDE_DIR} + ${QT_QTCORE_INCLUDE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ) + endif() #========================================================= #========================================================= #support for parallel deformable registration with OpenMP -IF(NOT __APPLE__) -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -march=native") -ENDIF(CMAKE_COMPILER_IS_GNUCC) -ENDIF(NOT __APPLE__) +if(NOT APPLE) +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") +endif(CMAKE_COMPILER_IS_GNUCC) +endif(NOT APPLE) #========================================================= #========================================================= -INCLUDE_DIRECTORIES( +include_directories( ../common ../tools + ../segmentation ) -LINK_DIRECTORIES(${QT_INCLUDES}) -ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON}) -TARGET_LINK_LIBRARIES(vv clitkCommon clitkDicomRTStruct clitkFilters ${ITK_LIBRARIES} QVTK vtkHybrid) +#========================================================= +#Add each tool's dependencies +foreach(tool ${vv_TOOLS}) + set(toolLibs ${toolLibs} ${${tool}_LIBS}) +endforeach(tool) -IF (CLITK_VV_USE_BDCM) - TARGET_LINK_LIBRARIES(vv bdcm) -ENDIF (CLITK_VV_USE_BDCM) +#========================================================= +#Add Foundation Libraries (this should be after our libraries, since we depend +#on them) +if(VTK_VERSION VERSION_GREATER "6.2.0") +set(foundationLibraries clitkCommon ${ITK_LIBRARIES} ${VTK_LIBRARIES}) +else() +set(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid) +endif() + +#========================================================= +# Use CxImage to create animated gifs +set(vvCxImage clitkCxImage) +set(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx) +include_directories(${CLITK_SOURCE_DIR}/utilities/CxImage) +add_subdirectory(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage) #========================================================= +#----------------------------------------------------------------------------- +# Avoid linker bug in Mac OS 10.5 +# See http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug +# +if(APPLE) + find_library(CoreFoundation_LIBRARY CoreFoundation REQUIRED) + find_library(ApplicationServices_LIBRARY ApplicationServices REQUIRED) + find_library(SystemConfiguration_LIBRARY SystemConfiguration REQUIRED) + find_library(Security_LIBRARY Security REQUIRED) + set(APPLE_FRAMEWORKS ${CoreFoundation_LIBRARY} + ${ApplicationServices_LIBRARY} + ${SystemConfiguration_LIBRARY} + ${Security_LIBRARY} + ) + message(STATUS "===== ${APPLE_FRAMEWORKS}") +endif() +#========================================================= +#Create binary and libs for tests +if(vv_QT_VERSION VERSION_GREATER "4") +set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} Qt5::Widgets Qt5::Network Qt5::Designer ${APPLE_FRAMEWORKS}) +else() +set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${APPLE_FRAMEWORKS}) +endif() +# QtNetwork is required by vvRegisterForm ${QT_QTNETWORK_LIBRARY} + +#----------------------------------------------------------------------------- +# For retina displays, see +# http://public.kitware.com/pipermail/vtkusers/2015-February/090117.html +if(APPLE) + set(vv_SRCS ${vv_SRCS} vvOSXHelper.mm) +endif() + +add_library(vvLib ${vv_SRCS} ${vv_UI_CXX}) +target_link_libraries(vvLib ${vvExternalLibs}) + +if(WIN32) + add_executable(vv WIN32 vv.cxx vvIcon.rc) +else(WIN32) + add_executable(vv vv.cxx) +endif(WIN32) + +target_link_libraries(vv vvLib) + #========================================================= # Install options (also used by CPack) -IF(UNIX AND NOT APPLE) - INSTALL(TARGETS vv - DESTINATION .) - #QT - FOREACH(LIB QtCore QtGui QtOpenGL QtWebKit QtXmlPatterns QtNetwork QtSql) - INSTALL(FILES "${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}" - RENAME "lib${LIB}.so.${QT_VERSION_MAJOR}" - DESTINATION .) - ENDFOREACH(LIB) - - #VTK - FOREACH(LIB QVTK vtkQtChart vtkViews vtkInfovis vtkWidgets vtkHybrid vtkRendering vtkImaging vtkGraphics vtkverdict - vtkIO vtkFiltering vtkCommon vtkDICOMParser vtkmetaio vtksqlite vtkpng vtktiff vtkjpeg vtkexpat vtksys - vtkftgl vtkfreetype vtkexoIIc vtkNetCDF vtklibxml2 vtkzlib vtkalglib) - INSTALL(FILES "${VTK_DIR}/bin/lib${LIB}.so.${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.0" - RENAME "lib${LIB}.so.${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}" - DESTINATION .) - ENDFOREACH(LIB) - - #ITK - FOREACH(LIB ITKAlgorithms ITKStatistics ITKFEM itkNetlibSlatec ITKNumerics ITKBasicFilters ITKIO ITKNrrdIO itkgdcm - itkjpeg12 itkjpeg16 itkopenjpeg itkpng itktiff itkjpeg8 ITKSpatialObject ITKCommon itkvnl_inst - itkvnl_algo itkv3p_netlib itkvnl itkvcl ITKMetaIO itksys ITKDICOMParser ITKEXPAT ITKniftiio ITKznz itkzlib) - INSTALL(FILES "${ITK_DIR}/bin/lib${LIB}.so.${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.0" - RENAME "lib${LIB}.so.${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}" - DESTINATION .) - ENDFOREACH(LIB) -ENDIF(UNIX AND NOT APPLE) - -IF(WIN32) - SET(EXE_ICON vvIcon.rc) -ENDIF(WIN32) +install(TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + +#========================================================= #========================================================= # CPack options -INCLUDE(InstallRequiredSystemLibraries) - -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !") -SET(CPACK_PACKAGE_VENDOR "Creatis-CLB") -SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") -SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt") -SET(CPACK_PACKAGE_VERSION_MAJOR "1") -SET(CPACK_PACKAGE_VERSION_MINOR "1") -SET(CPACK_PACKAGE_VERSION_PATCH "0") -SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv") -#IF(WIN32 AND NOT UNIX) +set(CPACK_PACKAGE_NAME "vv") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !") +set(CPACK_PACKAGE_VENDOR "Creatis-CLB") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt") +set(CPACK_PACKAGE_VERSION_MAJOR "1") +set(CPACK_PACKAGE_VERSION_MINOR "3") +set(CPACK_PACKAGE_VERSION_PATCH "0") +if(NIGHTLY) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly") +else(NIGHTLY) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv") +endif(NIGHTLY) +set(CPACK_STRIP_FILES TRUE) + +if(WIN32) # 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_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\ducky.png") -# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin/${CMAKE_BUILD_TYPE}\\\\vv.exe") -# SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} The 4D slicer") -# SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio") -# SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio") -# SET(CPACK_NSIS_MODIFY_PATH ON) -#ELSE(WIN32 AND NOT UNIX) -# SET(CPACK_STRIP_FILES "bin/vv") -# SET(CPACK_SOURCE_STRIP_FILES "") -#ENDIF(WIN32 AND NOT UNIX) -SET(CPACK_PACKAGE_EXECUTABLES "vv" "vv") -INCLUDE(CPack) + set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico") + set(CPACK_NSIS_INSTALLED_ICON_NAME "vv.exe") +if(NIGHTLY) + set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer (nightly)") +else(NIGHTLY) + set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer") +endif(NIGHTLY) + set(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv") + set(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio") + set(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr") + set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\bin\\\\vv.exe\\\" ") + set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ") + #set(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix + #set(CPACK_BINARY_ZIP ON) +else(WIN32) + set(CPACK_GENERATOR "STGZ") + set(CPACK_SOURCE_GENERATOR "TGZ") +endif(WIN32) +include(CPack) +#========================================================= +#========================================================= +configure_file(vvConfiguration.h.in vvConfiguration.h) +#=========================================================