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)
41 SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
42 SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
44 #=========================================================
45 # List of vv source files
47 # in COMMON_WITH_UI -> must have .h and .cxx and .ui
59 vvIntensityValueSlider
60 vvLabelImageLoaderWidget
62 vvToolSimpleInputSelectorWidget
63 vvToolInputSelectorWidget
64 vvToolStructureSetManager
69 vvQProgressDialogITKCommand.cxx
70 vvQDicomSeriesSelector.cxx
74 vvDeformableRegistration.cxx
76 vvInteractorStyleNavigator.cxx
83 vvSlicerManagerCommand.cxx
85 # vvMaximumIntensityProjection.cxx
90 vvImageMapToWLColors.cxx
93 vvBinaryImageOverlayActor.cxx
94 vvStructureSetActor.cxx
101 #=========================================================
102 # Qt related commands
103 FIND_PACKAGE(Qt4 REQUIRED)
110 vvQDicomSeriesSelector.h
113 vvStructureSetActor.h
118 QT4_WRAP_UI(vv_UI_CXX
119 qt_ui/vvHelpDialog.ui
120 qt_ui/vvDocumentation.ui
121 qt_ui/vvDicomSeriesSelector.ui
122 qt_ui/vvDummyWindow.ui #For testing
125 QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
127 #Add the autotools and the common files ui
128 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
129 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
130 QT4_WRAP_CPP(vv_SRCS ${tool}.h)
131 QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
134 #Add the common source files
135 foreach(tool ${vv_COMMON})
136 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
137 QT4_WRAP_CPP(vv_SRCS ${tool}.h)
140 # if Windows and Qt was built as a static lib then don't set QT_DLL flag
143 IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
144 FILE(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
145 IF(${QT_CORE_PRL} MATCHES "static")
147 ENDIF(${QT_CORE_PRL} MATCHES "static")
148 ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
151 ADD_DEFINITIONS(-DQT_DLL)
154 ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
159 ${QT_QTGUI_INCLUDE_DIR}
160 ${QT_QTCORE_INCLUDE_DIR}
161 ${CMAKE_CURRENT_BINARY_DIR}
162 ${CMAKE_CURRENT_SOURCE_DIR}
164 #=========================================================
166 #=========================================================
167 #support for parallel deformable registration with OpenMP
169 IF(CMAKE_COMPILER_IS_GNUCC)
170 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
171 ENDIF(CMAKE_COMPILER_IS_GNUCC)
173 #=========================================================
175 #=========================================================
183 SET(EXE_ICON vvIcon.rc)
186 LINK_DIRECTORIES(${QT_LIBRARY_DIR})
187 ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
188 ADD_DEPENDENCIES(vv clitkSegmentationGgoLib)
189 TARGET_LINK_LIBRARIES(vv clitkDicomRTStruct)
191 #=========================================================
192 #Add each tool's dependencies
193 foreach(tool ${vv_TOOLS})
194 target_link_libraries(vv ${${tool}_LIBS})
197 #=========================================================
198 #Add Foundation Libraries (this should be after our libraries, since we depend
200 TARGET_LINK_LIBRARIES(vv
201 clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
203 #=========================================================
204 # Install options (also used by CPack)
205 IF(UNIX AND NOT APPLE)
206 SET_TARGET_PROPERTIES(vv
207 PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
208 INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
209 # INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
212 #FOREACH(LIB QtCore QtGui QtOpenGL QtNetwork QtSql)
213 # INSTALL(FILES "${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}"
214 # RENAME "lib${LIB}.so.${QT_VERSION_MAJOR}"
217 ENDIF(UNIX AND NOT APPLE)
220 #INCLUDE(InstallRequiredSystemLibraries)
221 INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/vv.exe DESTINATION .)
222 #INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
224 #=========================================================
226 #=========================================================
228 SET(CPACK_PACKAGE_NAME "vv")
229 SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
230 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
231 SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
232 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
233 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
234 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
235 SET(CPACK_PACKAGE_VERSION_MINOR "2")
236 SET(CPACK_PACKAGE_VERSION_PATCH "0")
237 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
238 SET(CPACK_STRIP_FILES TRUE)
241 # There is a bug in NSI that does not handle full unix paths properly. Make
242 # sure there is at least one set of four (4) backlasshes.
243 SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
244 SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_BUILD_TYPE}\\\\vv.exe")
245 SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
246 SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
247 SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
248 SET(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
249 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\vv.exe\\\" ")
250 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
251 #SET(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
252 #SET(CPACK_BINARY_ZIP ON)
254 SET(CPACK_GENERATOR "STGZ")
255 SET(CPACK_SOURCE_GENERATOR "TGZ")
258 #=========================================================