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 #=========================================================
11 #=========================================================
12 #List of vv tools to compile
15 # vvToolRigidReg ## Very long to compile
20 # vvToolExtractPatient
23 vvToolConvert ## with dummy vvToolConvert.ui
25 ## these ones are for tests (not working)
27 # vvToolFooWithWidgetBase
29 # vvToolConnectedComponentLabeling
31 # dependencies of the tools
32 # Future issues : when tool depend on other tools ... how to manage that ?
33 # >> add the relevant $_LIBS variable to the tool that has dependencies?
34 SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib)
35 SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
36 SET(vvToolResample_LIBS clitkResampleImageLib)
37 SET(vvToolConvert_LIBS clitkImageConvertLib)
38 SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
39 SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
40 SET(vvToolCropImage_LIBS clitkCropImageLib)
41 SET(vvToolMIP_LIBS clitkMIPLib)
42 SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
43 SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
45 #=========================================================
46 # List of vv source files
48 # in COMMON_WITH_UI -> must have .h and .cxx and .ui
60 vvIntensityValueSlider
61 vvLabelImageLoaderWidget
63 vvToolSimpleInputSelectorWidget
64 vvToolInputSelectorWidget
65 vvToolStructureSetManager
71 vvQProgressDialogITKCommand.cxx
72 vvQDicomSeriesSelector.cxx
76 vvDeformableRegistration.cxx
78 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
121 QT4_WRAP_UI(vv_UI_CXX
122 qt_ui/vvHelpDialog.ui
123 qt_ui/vvRegisterForm.ui
124 qt_ui/vvDocumentation.ui
125 qt_ui/vvDicomSeriesSelector.ui
126 qt_ui/vvDummyWindow.ui #For testing
129 QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
131 #Add the autotools and the common files ui
132 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
133 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
134 QT4_WRAP_CPP(vv_SRCS ${tool}.h)
135 QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
137 #Add the common source files
138 foreach(tool ${vv_COMMON})
139 SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
140 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 #=========================================================
190 #Add each tool's dependencies
191 foreach(tool ${vv_TOOLS})
192 SET(toolLibs ${toolLibs} ${${tool}_LIBS})
194 #=========================================================
195 #Add Foundation Libraries (this should be after our libraries, since we depend
197 SET(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
199 #=========================================================
200 #Create binary and libs for tests
201 SET(vvExternalLibs clitkSegmentationGgoLib clitkDicomRTStruct ${toolLibs} ${foundationLibraries} CACHE INTERNAL DOCSTRING)
202 ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
203 ADD_DEPENDENCIES(vv clitkSegmentationGgoLib)
204 target_link_libraries(vv ${vvExternalLibs})
205 add_library(vvLib ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
207 #=========================================================
208 # Install options (also used by CPack)
209 IF(UNIX AND NOT APPLE)
210 SET_TARGET_PROPERTIES(vv
211 PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
212 INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
213 # INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
216 #FOREACH(LIB QtCore QtGui QtOpenGL QtNetwork QtSql)
217 # INSTALL(FILES "${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}"
218 # RENAME "lib${LIB}.so.${QT_VERSION_MAJOR}"
221 ENDIF(UNIX AND NOT APPLE)
224 #INCLUDE(InstallRequiredSystemLibraries)
225 INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/vv.exe DESTINATION .)
226 #INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
228 #=========================================================
230 #=========================================================
232 SET(CPACK_PACKAGE_NAME "vv")
233 SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
234 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
235 SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
236 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
237 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
238 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
239 SET(CPACK_PACKAGE_VERSION_MINOR "2")
240 SET(CPACK_PACKAGE_VERSION_PATCH "0")
241 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
242 SET(CPACK_STRIP_FILES TRUE)
245 # There is a bug in NSI that does not handle full unix paths properly. Make
246 # sure there is at least one set of four (4) backlasshes.
247 SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
248 SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_BUILD_TYPE}\\\\vv.exe")
249 SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
250 SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
251 SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
252 SET(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
253 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\vv.exe\\\" ")
254 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
255 #SET(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
256 #SET(CPACK_BINARY_ZIP ON)
258 SET(CPACK_GENERATOR "STGZ")
259 SET(CPACK_SOURCE_GENERATOR "TGZ")
262 #=========================================================
263 #=========================================================
264 configure_file(vvCommon.h.in vvCommon.h)
265 #=========================================================