1 cmake_minimum_required(VERSION 2.4)
3 #=========================================================
4 # To avoid warning with some version
5 if(COMMAND cmake_policy)
6 cmake_policy(SET CMP0003 NEW)
7 endif(COMMAND cmake_policy)
8 #=========================================================
10 #=========================================================
11 #List of vv tools to compile
14 # vvToolRigidReg ## Very long to compile
19 # vvToolExtractPatient
22 vvToolConvert ## with dummy vvToolConvert.ui
24 ## these ones are for tests (not working)
26 # vvToolFooWithWidgetBase
28 # vvToolConnectedComponentLabeling
30 # dependencies of the tools
31 # Future issues : when tool depend on other tools ... how to manage that ?
32 # >> add the relevant $_LIBS variable to the tool that has dependencies?
33 SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib)
34 SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
35 SET(vvToolResample_LIBS clitkResampleImageLib)
36 SET(vvToolConvert_LIBS clitkImageConvertLib)
37 SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
38 SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
39 SET(vvToolCropImage_LIBS clitkCropImageLib)
40 SET(vvToolMIP_LIBS clitkMIPLib)
42 #=========================================================
43 # List of vv source files
45 # in COMMON_WITH_UI -> must have .h and .cxx and .ui
57 vvIntensityValueSlider
58 vvLabelImageLoaderWidget
60 vvToolSimpleInputSelectorWidget
61 vvToolInputSelectorWidget
62 vvToolStructureSetManager
67 vvQProgressDialogITKCommand.cxx
68 vvQDicomSeriesSelector.cxx
72 vvDeformableRegistration.cxx
74 vvInteractorStyleNavigator.cxx
85 vvSlicerManagerCommand.cxx
87 # vvMaximumIntensityProjection.cxx
92 vvImageMapToWLColors.cxx
95 vvBinaryImageOverlayActor.cxx
96 vvStructureSetActor.cxx
100 vvToolCreatorBase.cxx
103 #=========================================================
104 # Qt related commands
105 FIND_PACKAGE(Qt4 REQUIRED)
112 vvQDicomSeriesSelector.h
115 vvStructureSetActor.h
120 QT4_WRAP_UI(vv_UI_CXX
121 qt_ui/vvHelpDialog.ui
122 qt_ui/vvDocumentation.ui
123 qt_ui/vvDicomSeriesSelector.ui
124 qt_ui/vvDummyWindow.ui #For testing
127 QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
129 #Add the autotools and the common files ui
130 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
131 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
132 QT4_WRAP_CPP(vv_SRCS ${tool}.h)
133 QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
136 #Add the common source files
137 foreach(tool ${vv_COMMON})
138 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
139 QT4_WRAP_CPP(vv_SRCS ${tool}.h)
142 # if Windows and Qt was built as a static lib then don't set QT_DLL flag
145 IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
146 FILE(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
147 IF(${QT_CORE_PRL} MATCHES "static")
149 ENDIF(${QT_CORE_PRL} MATCHES "static")
150 ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
153 ADD_DEFINITIONS(-DQT_DLL)
156 ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
161 ${QT_QTGUI_INCLUDE_DIR}
162 ${QT_QTCORE_INCLUDE_DIR}
163 ${CMAKE_CURRENT_BINARY_DIR}
164 ${CMAKE_CURRENT_SOURCE_DIR}
166 #=========================================================
168 #=========================================================
169 #support for parallel deformable registration with OpenMP
171 IF(CMAKE_COMPILER_IS_GNUCC)
172 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
173 ENDIF(CMAKE_COMPILER_IS_GNUCC)
175 #=========================================================
177 #=========================================================
185 SET(EXE_ICON vvIcon.rc)
188 LINK_DIRECTORIES(${QT_LIBRARY_DIR})
189 ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
190 ADD_DEPENDENCIES(vv clitkSegmentationGgoLib)
191 TARGET_LINK_LIBRARIES(vv clitkDicomRTStruct)
193 #=========================================================
194 #Add each tool's dependencies
195 foreach(tool ${vv_TOOLS})
196 target_link_libraries(vv ${${tool}_LIBS})
199 #=========================================================
200 #Add Foundation Libraries (this should be after our libraries, since we depend
202 TARGET_LINK_LIBRARIES(vv
203 clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
205 #=========================================================
206 # Install options (also used by CPack)
207 IF(UNIX AND NOT APPLE)
208 SET_TARGET_PROPERTIES(vv
209 PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
210 INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
211 # INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
214 #FOREACH(LIB QtCore QtGui QtOpenGL QtNetwork QtSql)
215 # INSTALL(FILES "${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}"
216 # RENAME "lib${LIB}.so.${QT_VERSION_MAJOR}"
219 ENDIF(UNIX AND NOT APPLE)
222 #INCLUDE(InstallRequiredSystemLibraries)
223 INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/vv.exe DESTINATION .)
224 #INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
226 #=========================================================
228 #=========================================================
230 SET(CPACK_PACKAGE_NAME "vv")
231 SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
232 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
233 SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
234 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
235 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
236 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
237 SET(CPACK_PACKAGE_VERSION_MINOR "1")
238 SET(CPACK_PACKAGE_VERSION_PATCH "0")
239 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
242 # There is a bug in NSI that does not handle full unix paths properly. Make
243 # sure there is at least one set of four (4) backlasshes.
244 SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
245 SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_BUILD_TYPE}\\\\vv.exe")
246 SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
247 SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
248 SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
249 SET(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
250 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\vv.exe\\\" ")
251 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
252 #SET(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
253 #SET(CPACK_BINARY_ZIP ON)
255 SET(CPACK_GENERATOR "STGZ")
256 SET(CPACK_SOURCE_GENERATOR "TGZ")
259 #=========================================================