5 # To make an installer,
6 # - configure cmake with -DPACKAGING_NSIS:BOOL=TRUE (on windows AND unix)
7 # - use the custom target camitk_package, e.g "make camitk_package"
10 # CMake configure command (from the build directory) :
11 # cmake -DPACKAGING_NSIS=TRUE -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DCAMITK_DICOM_INCOMPLETE_SUPPORT=FALSE -DCOMPONENT_DICOMDIRECTORY=TRUE -DCOMPONENT_DICOMIMAGE=TRUE -DAPPLICATION_CEPGENERATOR=FALSE -DAPPLICATION_TESTACTIONS=FALSE -DAPPLICATION_TESTCOMPONENTS=FALSE -DAPPLICATION_WIZARD=FALSE ../src
12 # Launch the camitkopensource.sln visual studio solution file.
13 # Build all in Release (do it again if some .h files missing errors occured)
14 # Build camitk_package target.
17 # cmake -DCMAKE_SKIP_RPATH:BOOL=ON \
18 # -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \
19 # -DCMAKE_BUILD_TYPE:STRING=None \
21 # -DCEP_IMAGING:BOOL=TRUE \
22 # -DCAMITK_DICOM_INCOMPLETE_SUPPORT:BOOL=FALSE \
23 # -DCOMPONENT_DICOMDIRECTORY=TRUE \
24 # -DCOMPONENT_DICOMIMAGE=TRUE
26 # -DCEP_MODELING:BOOL=TRUE \
28 # -DAPIDOC_SDK:BOOL=TRUE \
30 # -DPACKAGING_NSIS:BOOL=TRUE \
31 # -DCMAKE_INSTALL_PREFIX=/usr
33 # On debian/ubuntu, you need to have package "dpkg" (to build DEB packages) and package "rpm" (to build RPM packages) installed:
34 # apt-get install dpkg rpm
36 # To make a source tar ball, just use the custom target camitk_package_sourc
37 # - make camitk_package_source
38 # (it generates the correct CamiTKVersion.h)
40 # To check the content of a deb package:
41 # dpkg --contents package.deb
42 # To install the content of a deb in a subdirectory instead of system-wide:
43 # dpkg --vextract package.deb subdirectory
45 # On windows for the NSIS packager, to generate different components that can be opt out at install time, see
46 # http://www.itk.org/Wiki/CMake:Component_Install_With_CPack
48 # More generally see http://www.itk.org/Wiki/CMake:CPackConfiguration
50 # There is a bug deb package (cmake 2.8.9 on Debian Wheezy): permission for directories are not rights
51 # Here is how to fix it (inspired from https://github.com/paralect/robomongo/blob/master/install/linux/fixup_deb.sh.in )
52 # set PACKAGE_FILENAME="camitk-3.3.0-debian-7.x-wheezy_amd64.deb"
55 # dpkg-deb -x $PACKAGE_FILENAME camitk-deb
56 # dpkg-deb --control $PACKAGE_FILENAME camitk-deb/DEBIAN
57 # rm $PACKAGE_FILENAME
58 # find camitk-deb -type d -print0 |xargs -0 chmod 755
59 # find camitk-deb -name "*.1" -print0 |xargs -0 chmod 0644
60 # find fix_up_deb/usr/bin -name "camitk-*" -print0 |xargs -0 chmod 0755
61 # fakeroot dpkg -b camitk-deb $PACKAGE_FILENAME
68 string(TOLOWER ${CAMITK_PROJECT_NAME} CPACK_PACKAGE_NAME)
69 set(CPACK_PACKAGE_VERSION_MAJOR ${CAMITK_VERSION_MAJOR})
70 set(CPACK_PACKAGE_VERSION_MINOR ${CAMITK_VERSION_MINOR})
71 set(CPACK_PACKAGE_VERSION_PATCH ${CAMITK_VERSION_PATCH})
72 set(CPACK_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
73 string(TOLOWER
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CAMITK_VER_NICKNAME}-${LSB_DISTRIB}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
76 set(CPACK_PACKAGE_VENDOR
"UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525")
77 set(CPACK_PACKAGE_CONTACT
"http://camitk.imag.fr")
78 set(CPACK_DEBIAN_PACKAGE_MAINTAINER
"CamiTK Developers <camitk-team@imag.fr>")
81 set(CPACK_RESOURCE_FILE_README
"${CMAKE_CURRENT_SOURCE_DIR}/README")
82 set(CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT")
85 set(CPACK_PACKAGE_EXECUTABLES
"camitk-imp" "camitk-imp" "camitk-actionstatemachine" "camitk-actionstatemachine")
87 # CamiTK package description
88 set(CPACK_PACKAGE_DESCRIPTION
"CamiTK stands for Computer Assisted Medical Intervention Tool Kit and aims at providing an easy way to protype medical applications")
89 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"CamiTK stands for Computer Assisted Medical Intervention Tool Kit and aims at providing an easy way to protype medical applications. CamiTK functionnalities are extendable thanks to plugins. This package includes the IMP application with main plugins that allow users to interact with medical images (2D, 3D), process them and simulate biomechanichal deformations. It also includes the actionstatemachine application that allows user to easily run a pipelines of algorithms on images.")
91 # Files to ignore during generation of the package
92 set(CPACK_SOURCE_IGNORE_FILES
104 "\\\\.kdevelop\\\\.pcs$"
106 ${CPACK_SOURCE_IGNORE_FILES}
109 set(CPACK_SOURCE_GENERATOR
"TGZ" "ZIP" )
111 # Detect processor bits range (32bits / 64bits)
112 # not the whole architecture (ARM ...).
113 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
120 # ----------------------------------
121 # Unix packages (Ubuntu and Debian)
122 # ----------------------------------
123 if (PACKAGING_NSIS AND UNIX AND NOT WIN32)
125 # Note : even if not packaging for Unix with NSIS, the CMake variable
126 # PACKAGING_NSIS is used here to indicate we are packaging (i.e. building
127 # the camitk_package target).
129 message(STATUS
"Packaging CamiTK for UNIX systems")
130 # Try to find architecture
131 execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
132 string(STRIP
"${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
133 # Try to find distro name and distro-specific arch
136 string(STRIP
"${LSB_ID}" LSB_ID)
137 string(STRIP
"${LSB_RELEASE}" LSB_RELEASE)
138 set(LSB_DISTRIB
"${LSB_ID}${LSB_RELEASE}")
140 set(LSB_DISTRIB
"unix")
141 endif(NOT LSB_DISTRIB)
142 message(STATUS
"Packager architecture : ${LSB_DISTRIB}")
145 set(CPACK_DEBIAN_PACKAGE_SECTION
"science")
150 PATHS
"/usr/bin" #Add paths here
154 message(STATUS
"Packaging deb using ${DPKG_PATH}: OK")
155 set(DPKG_FOUND
"YES")
160 # Packaging requires ITK
161 find_package(ITK REQUIRED)
162 include(${ITK_USE_FILE})
164 #
set the package generator
165 set(CPACK_GENERATOR
"DEB" "RPM")
167 # For Debian-based distribs we want to create DEB packages.
168 if (
"${LSB_DISTRIB}" MATCHES
"Ubuntu|Debian")
170 # We need to alter the architecture names as per distro rules
171 if(
"${CPACK_PACKAGE_ARCHITECTURE}" MATCHES
"i[3-6]86")
172 set(CPACK_PACKAGE_ARCHITECTURE i386)
174 if(
"${CPACK_PACKAGE_ARCHITECTURE}" MATCHES
"x86_64")
175 set(CPACK_PACKAGE_ARCHITECTURE amd64)
177 # Set the dependencies based on the distrib version
180 # Set the install location to "/usr"
181 # PLEASE, set the CamiTK install root path in your CMake command line / GUI (and not directly here)
182 set(CPACK_SET_DESTDIR TRUE)
183 set(CPACK_PACKAGING_INSTALL_PREFIX
"/usr")
184 set(CPACK_PACKAGE_DEFAULT_LOCATION
"/usr")
187 # Dependencies depending on the Operating System.
189 # WARNING Beware to the syntax of the Debian package dependencies, else it won't manage to install.
190 if(
"${LSB_DISTRIB}" MATCHES
"Ubuntu12.04"
191 OR
"${LSB_DISTRIB}" MATCHES
"Ubuntu12.04.1"
192 OR
"${LSB_DISTRIB}" MATCHES
"Ubuntu12.10"
193 OR
"${LSB_DISTRIB}" MATCHES
"Ubuntu13.04"
194 OR
"${LSB_DISTRIB}" MATCHES
"Ubuntu13.10"
196 # All these ubuntu version dependencies are the same, only one package is needed for all
197 set(LSB_DISTRIB
"Ubuntu12.04to13.10")
198 set(CPACK_DEBIAN_PACKAGE_DEPENDS
"cmake, libvtk5-dev (>= 5.8), libqt4-dev, libvtk5-qt4-dev (>= 5.8), xsdcxx, libinsighttoolkit3-dev (>= 3.20), libxerces-c-dev, libxml2-dev, libgdcm2-dev, libfftw3-dev, libqtwebkit-dev | libqt4-dev (<< 4.7), libvtkgdcm2-dev,doxygen, graphviz")
201 # Debian dependencies
202 if (
"${LSB_DISTRIB}" MATCHES
"Debian7.*") # Debian Wheezy
203 set(LSB_DISTRIB
"Debian-7.x-Wheezy")
204 set(CPACK_DEBIAN_PACKAGE_DEPENDS
"libqt4-dev (>= 4:4.8), libqtwebkit4 (>= 2), libqtwebkit-dev (>= 2), libvtk5.8 (>= 5.8.0), libvtk5-dev (>= 5.8.0), libvtk5.8-qt4 (>= 5.8.0), libvtk5-qt4-dev (>= 5.8.0), libinsighttoolkit3-dev (>= 3.20.1), vtk-doc (>= 5.8.0), tcl-vtk (>= 5.8.0), libinsighttoolkit3.20 (>= 3.20.1), libtiff4-dev (>= 3.9), libopenjpeg-dev (>= 1.3), libxml2 (>= 2.7.8), libxml2-dev (>= 2.7.8), xsdcxx (>= 3.3.0), libxerces-c-dev (>= 3.1.1), libgdcm2.2 (>= 2), libgdcm2-dev (>= 2), libvtkgdcm2.2 (>= 2), libvtkgdcm2-dev (>= 2)")
207 if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
208 message(STATUS
"Packaging for ${LSB_DISTRIB} not supported yet.\n")
214 string(TOLOWER
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${LSB_DISTRIB}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
219 # -----------------------
220 # Packaging for Windows
221 # -----------------------
222 if(WIN32 AND MSVC AND PACKAGING_NSIS)
224 # NSIS must be installed on the computer
225 find_program(MAKENSIS makensis.exe)
227 message(STATUS
"NSIS Packaging using ${MAKENSIS}")
229 message(FATAL_ERROR
"NSIS executable (makensis.exe) is not installed or not in the system path. Please fix this problem for packaging.")
232 # Update package name for windows release
233 if(WIN64) #64 bits installer
234 set(CPACK_PACKAGE_ARCHITECTURE amd64)
235 else() #32 bits installer
236 set(CPACK_PACKAGE_ARCHITECTURE i386)
238 string(TOLOWER
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CAMITK_VER_NICKNAME}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
240 message(STATUS
"Packaging CamiTK for Windows: ${CPACK_PACKAGE_FILE_NAME}")
242 if(WIN64) # 64bits installer
244 set(QT_PACKAGE_LIRABRIES
245 C:/dev/Qt/4.8.5/bin/QtCore4.dll
246 C:/dev/Qt/4.8.5/bin/QtGui4.dll
247 C:/dev/Qt/4.8.5/bin/QtSvg4.dll
248 C:/dev/Qt/4.8.5/bin/QtXml4.dll
249 C:/dev/Qt/4.8.5/bin/QtNetwork4.dll
250 C:/dev/Qt/4.8.5/bin/QtSql4.dll
251 C:/dev/Qt/4.8.5/bin/QtWebKit4.dll
255 set(VTK_PACKAGE_LIBRARIES
256 C:/dev/VTK/5.10.1/bin/QVTK.dll
257 C:/dev/VTK/5.10.1/bin/vtkCommon.dll
258 C:/dev/VTK/5.10.1/bin/vtksys.dll
259 C:/dev/VTK/5.10.1/bin/vtkFiltering.dll
260 C:/dev/VTK/5.10.1/bin/vtkGraphics.dll
261 C:/dev/VTK/5.10.1/bin/vtkHybrid.dll
262 C:/dev/VTK/5.10.1/bin/vtkIO.dll
263 C:/dev/VTK/5.10.1/bin/vtkImaging.dll
264 C:/dev/VTK/5.10.1/bin/vtkRendering.dll
265 C:/dev/VTK/5.10.1/bin/vtkVolumeRendering.dll
266 C:/dev/VTK/5.10.1/bin/vtkverdict.dll
267 C:/dev/VTK/5.10.1/bin/vtkDICOMParser.dll
268 C:/dev/VTK/5.10.1/bin/vtkNetCDF.dll
269 C:/dev/VTK/5.10.1/bin/vtkNetCDF_cxx.dll
270 C:/dev/VTK/5.10.1/bin/vtkexpat.dll
271 C:/dev/VTK/5.10.1/bin/vtkjpeg.dll
272 C:/dev/VTK/5.10.1/bin/vtkmetaio.dll
273 C:/dev/VTK/5.10.1/bin/vtkpng.dll
274 C:/dev/VTK/5.10.1/bin/vtktiff.dll
275 C:/dev/VTK/5.10.1/bin/vtkzlib.dll
276 C:/dev/VTK/5.10.1/bin/vtkInfovis.dll
277 C:/dev/VTK/5.10.1/bin/vtkfreetype.dll
278 C:/dev/VTK/5.10.1/bin/vtkftgl.dll
279 C:/dev/VTK/5.10.1/bin/vtkalglib.dll
280 C:/dev/VTK/5.10.1/bin/vtklibxml2.dll
281 C:/dev/VTK/5.10.1/bin/vtkViews.dll
282 C:/dev/VTK/5.10.1/bin/vtkexoIIc.dll
283 C:/dev/VTK/5.10.1/bin/vtkWidgets.dll
284 C:/dev/VTK/5.10.1/bin/vtkhdf5.dll
285 C:/dev/VTK/5.10.1/bin/vtkhdf5_hl.dll
286 C:/dev/VTK/5.10.1/bin/LSDyna.dll
290 set(ITK_PACKAGE_LIBRARIES
291 C:/dev/ITK/4.3.2/bin/ITKCommon-4.3.dll
295 set(GDCM_PACKAGE_LIBRARIES
296 C:/dev/gdcm/2.5/bin/vtkgdcm.dll
297 C:/dev/gdcm/2.5/bin/gdcmcommon.dll
298 C:/dev/gdcm/2.5/bin/gdcmcharls.dll
299 C:/dev/gdcm/2.5/bin/gdcmdict.dll
300 C:/dev/gdcm/2.5/bin/gdcmdsed.dll
301 C:/dev/gdcm/2.5/bin/gdcmexpat.dll
302 C:/dev/gdcm/2.5/bin/gdcmiod.dll
303 C:/dev/gdcm/2.5/bin/gdcmjpeg12.dll
304 C:/dev/gdcm/2.5/bin/gdcmjpeg16.dll
305 C:/dev/gdcm/2.5/bin/gdcmjpeg8.dll
306 C:/dev/gdcm/2.5/bin/gdcmmsff.dll
307 C:/dev/gdcm/2.5/bin/gdcmopenjpeg.dll
308 C:/dev/gdcm/2.5/bin/gdcmzlib.dll
309 C:/dev/gdcm/2.5/bin/gdcmmsff.dll
312 set(LIBXML2_PACKAGE_LIBRARIES
313 C:/dev/libxml2/2.9.1/bin/libiconv-2.dll
314 C:/dev/libxml2/2.9.1/bin/libxml2-2.dll
315 C:/dev/libxml2/2.9.1/bin/zlib1.dll
318 set(XERCES_C_PACKAGE_LIBRARIES
319 C:/dev/xerces-c/3.1.1/bin/xerces-c_3_1.dll
322 else() # 32bits installer
325 set(QT_PACKAGE_LIRABRIES
326 C:/dev_x86/Qt/4.8.5/bin/QtCore4.dll
327 C:/dev_x86/Qt/4.8.5/bin/QtGui4.dll
328 C:/dev_x86/Qt/4.8.5/bin/QtSvg4.dll
329 C:/dev_x86/Qt/4.8.5/bin/QtXml4.dll
330 C:/dev_x86/Qt/4.8.5/bin/QtNetwork4.dll
331 C:/dev_x86/Qt/4.8.5/bin/QtSql4.dll
332 C:/dev_x86/Qt/4.8.5/bin/QtWebKit4.dll
336 # set(VTK_DIR ${VTK_DIR}/../../bin)
337 set(VTK_PACKAGE_LIBRARIES
338 C:/dev_x86/VTK/5.10.1/bin/QVTK.dll
339 C:/dev_x86/VTK/5.10.1/bin/vtkCommon.dll
340 C:/dev_x86/VTK/5.10.1/bin/vtksys.dll
341 C:/dev_x86/VTK/5.10.1/bin/vtkFiltering.dll
342 C:/dev_x86/VTK/5.10.1/bin/vtkGraphics.dll
343 C:/dev_x86/VTK/5.10.1/bin/vtkHybrid.dll
344 C:/dev_x86/VTK/5.10.1/bin/vtkIO.dll
345 C:/dev_x86/VTK/5.10.1/bin/vtkImaging.dll
346 C:/dev_x86/VTK/5.10.1/bin/vtkRendering.dll
347 C:/dev_x86/VTK/5.10.1/bin/vtkVolumeRendering.dll
348 C:/dev_x86/VTK/5.10.1/bin/vtkverdict.dll
349 C:/dev_x86/VTK/5.10.1/bin/vtkDICOMParser.dll
350 C:/dev_x86/VTK/5.10.1/bin/vtkNetCDF.dll
351 C:/dev_x86/VTK/5.10.1/bin/vtkNetCDF_cxx.dll
352 C:/dev_x86/VTK/5.10.1/bin/vtkexpat.dll
353 C:/dev_x86/VTK/5.10.1/bin/vtkjpeg.dll
354 C:/dev_x86/VTK/5.10.1/bin/vtkmetaio.dll
355 C:/dev_x86/VTK/5.10.1/bin/vtkpng.dll
356 C:/dev_x86/VTK/5.10.1/bin/vtktiff.dll
357 C:/dev_x86/VTK/5.10.1/bin/vtkzlib.dll
358 C:/dev_x86/VTK/5.10.1/bin/vtkInfovis.dll
359 C:/dev_x86/VTK/5.10.1/bin/vtkfreetype.dll
360 C:/dev_x86/VTK/5.10.1/bin/vtkftgl.dll
361 C:/dev_x86/VTK/5.10.1/bin/vtkalglib.dll
362 C:/dev_x86/VTK/5.10.1/bin/vtklibxml2.dll
363 C:/dev_x86/VTK/5.10.1/bin/vtkViews.dll
364 C:/dev_x86/VTK/5.10.1/bin/vtkexoIIc.dll
365 C:/dev_x86/VTK/5.10.1/bin/vtkWidgets.dll
366 C:/dev_x86/VTK/5.10.1/bin/vtkhdf5.dll
367 C:/dev_x86/VTK/5.10.1/bin/vtkhdf5_hl.dll
368 C:/dev_x86/VTK/5.10.1/bin/LSDyna.dll
372 set(ITK_PACKAGE_LIBRARIES
373 C:/dev_x86/ITK/4.3.2/bin/ITKCommon-4.3.dll
377 set(GDCM_PACKAGE_LIBRARIES
378 C:/dev_x86/gdcm/2.2.5/bin/vtkgdcm.dll
379 C:/dev_x86/gdcm/2.2.5/bin/gdcmcommon.dll
380 C:/dev_x86/gdcm/2.2.5/bin/gdcmcharls.dll
381 C:/dev_x86/gdcm/2.2.5/bin/gdcmdict.dll
382 C:/dev_x86/gdcm/2.2.5/bin/gdcmdsed.dll
383 C:/dev_x86/gdcm/2.2.5/bin/gdcmexpat.dll
384 C:/dev_x86/gdcm/2.2.5/bin/gdcmiod.dll
385 C:/dev_x86/gdcm/2.2.5/bin/gdcmjpeg12.dll
386 C:/dev_x86/gdcm/2.2.5/bin/gdcmjpeg16.dll
387 C:/dev_x86/gdcm/2.2.5/bin/gdcmjpeg8.dll
388 C:/dev_x86/gdcm/2.2.5/bin/gdcmmsff.dll
389 C:/dev_x86/gdcm/2.2.5/bin/gdcmopenjpeg.dll
390 C:/dev_x86/gdcm/2.2.5/bin/gdcmzlib.dll
391 C:/dev_x86/gdcm/2.2.5/bin/gdcmmsff.dll
394 set(LIBXML2_PACKAGE_LIBRARIES
395 C:/dev_x86/libxml2/2.7.8/bin/iconv.dll
396 C:/dev_x86/libxml2/2.7.8/bin/libxml2.dll
397 C:/dev_x86/libxml2/2.7.8/bin/zlib1.dll
400 set(XERCES_C_PACKAGE_LIBRARIES
401 C:/dev_x86/xerces-c/3.1.1/bin/xerces-c_3_1.dll
403 endif()
# end compiler specific settings
405 # Additional libraries to install with the installer
406 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
407 ${QT_PACKAGE_LIRABRIES}
408 ${VTK_PACKAGE_LIBRARIES}
409 ${ITK_PACKAGE_LIBRARIES}
410 ${GDCM_PACKAGE_LIBRARIES}
411 ${LIBXML2_PACKAGE_LIBRARIES}
412 ${XERCES_C_PACKAGE_LIBRARIES}
415 # By
default,
do not warn when built on machines
using only VS Express:
416 if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
417 SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
420 # Tell CMake to copy CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS content into the package
421 include(InstallRequiredSystemLibraries)
424 set(CAMITK_PACKAGE_ICON
"${CMAKE_CURRENT_SOURCE_DIR}\\\\sdk\\\\libraries\\\\core\\\\resources\\\\appIcon.ico")
#set here the current icon for CamiTK
425 set(CPACK_PACKAGE_ICON ${CAMITK_PACKAGE_ICON}) #icon
for the top bar NSIS installer
426 set(CPACK_NSIS_MUI_ICON ${CAMITK_PACKAGE_ICON}) #icon
for the generated install program (the .exe to run to install CamiTK).
427 set(CPACK_NSIS_MUI_UNIICON ${CAMITK_PACKAGE_ICON}) #icon
for the generated uninstall program (the .exe to run to uninstall CamiTK).
429 # Create desktop icons, by forcing CPack to build an
internal command, as
'set(CPACK_NSIS_MODIFY_PATH ON)' option setted in the additional page doesn
't work.
430 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut \\\"$DESKTOP\\\\${CAMITK_PROJECT_NAME}-imp.lnk\\\" \\\"$INSTDIR\\\\bin\\\\camitk-imp.exe\\\"")
432 # Tell CPack to remove the icons after uninstalling
433 set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\${CAMITK_PROJECT_NAME}-imp.lnk\\\"")
436 set(CPACK_NSIS_DISPLAY_NAME "CamiTK ${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}.${CAMITK_VERSION_PATCH}")
437 set(CPACK_NSIS_INSTALLED_ICON_NAME ${CAMITK_PROJECT_NAME})
439 set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CAMITK_PROJECT_NAME})
440 set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\camitk.imag.fr")
441 set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\camitk.imag.fr")
442 set(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
449 if(PACKAGING_NSIS AND APPLE)
451 set(CPACK_GENERATOR "PackageMaker")
452 # Libraries are bundled directly
453 set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
455 set(MACOSX_BUNDLE_BUNDLE_NAME ${CPACK_PACKAGE_NAME})
456 set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
457 set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
458 set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION}")
463 # Set up CPack configuration
466 # Create the groups that will contains the installer components
467 cpack_add_component_group(SDK
468 DISPLAY_NAME "CamiTK SDK"
469 DESCRIPTION "The CamiTK SDK features the core and basics extensions. CamiTK installation requires at least the SDK"
472 cpack_add_component_group(CEP_IMAGING
473 DISPLAY_NAME "CEP Imaging"
474 DESCRIPTION "The CamiTK Extension Project IMAGING contains image processing extensions. Those extensions are optional."
476 cpack_add_component_group(CEP_MODELING
477 DISPLAY_NAME "CEP Modeling"
478 DESCRIPTION "The CamiTK Extension Project MODELING contains biomechanical extensions. Those extensions are optional."
481 # ----------------------------------
482 # CamiTK specific packaging targets
483 # ----------------------------------
485 # create specific target for package source
486 # When packaging, copy the CamiTKPackageVersion.h file to the source directory
487 # Don't forget to
remove it immediatly after packaging.
488 add_custom_target(camitk_package_source
489 COMMAND ${CMAKE_COMMAND}
490 -E copy ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h
491 ${CMAKE_CURRENT_SOURCE_DIR}/sdk/libraries/core/CamiTKVersion.h
492 COMMAND ${CMAKE_COMMAND}
493 --build ${CMAKE_BINARY_DIR}
494 --target package_source
495 COMMAND ${CMAKE_COMMAND}
496 -E
remove -f ${CMAKE_CURRENT_SOURCE_DIR}/sdk/libraries/core/CamiTKVersion.h
499 # This target create the installer / linux package.
500 # On windows, you have configured with PACKAGING_NSIS=TRUE => all project names have their
"-" replaced by
"_" character
501 # NSIS doesn
't support "-" character.
502 add_custom_target(camitk_package
503 COMMAND ${CMAKE_COMMAND}
504 -E copy ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h
505 ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h-backup
506 COMMAND ${CMAKE_COMMAND}
507 -E copy ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h
508 ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h
509 COMMAND ${CMAKE_COMMAND}
510 --build ${CMAKE_BINARY_DIR}
512 COMMAND ${CMAKE_COMMAND}
513 -E copy ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h-backup
514 ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h
camitk_opensource_packaging()
Definition: CamiTKOpenSourcePackaging.h:65
test result execute_process(COMMAND ${CMAKE_COMMAND}-E remove-f ${CAMITK_TEST_COMMAND_FILE}${CAMITK_TEST_COMMAND_RESULT_FILE}${CAMITK_TEST_COMMAND_OUTPUT_FILE}${CAMITK_TEST_PASS_FILE_COMMAND_FILE}${CAMITK_TEST_PASS_FILE_OUTPUT_FILE}${CAMITK_TEST_PASS_FILE_RESULT_FILE}) file(WRITE $
Definition: CamiTKTestPassFile.h:19
set(CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) set(CAMITK_TEST_COMMAND_RESULT_FILE $
This CMake file run a command and put the output in a given file.
Definition: CamiTKTestPassFile.h:11
get_filename_component(OUTFILE ${CAMITK_TEST_PASS_FILE}NAME) set(CAMITK_TEST_COMMAND_OUTPUT_FILE $
This CMake file run a command and put the output in a given file.
Definition: CamiTKTestCompareFile.h:11