]> Creatis software - creaImageIO.git/blob - install/CMakeLists.txt
Feature #1764
[creaImageIO.git] / install / CMakeLists.txt
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and 
10 #  abiding by the rules of distribution of free software. You can  use, 
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
12 #  license as circulated by CEA, CNRS and INRIA at the following URL 
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability. 
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------
25
26 #-----------------------------------------------------------------------------
27 # CPACK+NSIS PACKAGING
28 #-----------------------------------------------------------------------------
29
30 #---Documentation-------------
31 #http://www.cmake.org/Wiki/CMake:Packaging_With_CPack
32 #http://www.cmake.org/Wiki/CMake:CPackConfiguration
33 #http://www.cmake.org/Wiki/CMake:Install_Commands
34
35 INCLUDE(InstallRequiredSystemLibraries)
36
37 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} - CREATIS")
38 SET(CPACK_PACKAGE_VENDOR "CREATIS")
39 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.txt")
40 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
41 SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
42 SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_MINOR_VERSION})
43 SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_BUILD_VERSION})
44
45 IF(WIN32)
46         SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools\\\\${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
47 ELSE(WIN32)
48         SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools/${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
49 ENDIF(WIN32)
50
51 IF(WIN32)
52         SET(CMAKE_INSTALL_PREFIX C:/CreaTools/${PROJECT_NAME})
53 ENDIF(WIN32)
54
55
56 IF(WIN32 AND NOT UNIX)
57   # There is a bug in NSI that does not handle full unix paths properly. Make
58   # sure there is at least one set of four (4) backlasshes.
59 #EED  SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/kernel/install/gnome/bbi-icon2.bmp")
60 #  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin/BBI_EXE.exe")
61   SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
62   SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
63   SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
64   SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr")
65   SET(CPACK_NSIS_MODIFY_PATH ON)
66 ELSE(WIN32 AND NOT UNIX)
67 #  SET(CPACK_STRIP_FILES "bin/bbi")
68   SET(CPACK_SOURCE_STRIP_FILES "")
69 ENDIF(WIN32 AND NOT UNIX)
70 SET(CPACK_PACKAGE_EXECUTABLES "creaImageIOApp" "creaImageIOApp")
71   
72
73 INCLUDE(CPack)
74
75 OPTION(BUILD_STANDALONE_INSTALLER "Build installer which installs all the third-party dynamic libraries needed ?" OFF) 
76 IF(BUILD_STANDALONE_INSTALLER) 
77   SET (ADDITIONAL_DLL_PATH "C:/Program Files/CreaTools/crea_ThirdParty_dlls-0.2.0/bin" CACHE PATH "Additional paths in which to look for dlls")
78 ENDIF(BUILD_STANDALONE_INSTALLER)
79
80
81 # Aditional INSTALL for CPACK mecanism.
82 IF (WIN32)
83   INSTALL( FILES ${PROJECT_BINARY_DIR}/RelWithDebInfo/sqlite3.dll DESTINATION bin ) 
84   INSTALL( FILES ${PROJECT_SOURCE_DIR}/win32/sqlite3.h DESTINATION include/creaImageIO ) 
85 ENDIF (WIN32)
86
87
88 #-- share/creaImageIO --
89
90 IF (WIN32)
91   SET(INSTALL_DATA_DIR "bin/share/creaImageIO")
92 ELSE (WIN32)
93   SET(INSTALL_DATA_DIR "share/creaImageIO/")
94 ENDIF (WIN32)
95 INSTALL( FILES ${PROJECT_SOURCE_DIR}/src/data/localdatabase_Descriptor.dscp DESTINATION ${INSTALL_DATA_DIR} )
96  
97
98
99 IF (BUILD_STANDALONE_INSTALLER)
100
101   IF(WIN32)
102    INSTALL( FILES ${SYSTEMROOT}/system32/msvcp71d.dll                     DESTINATION bin/ )
103    INSTALL( FILES ${SYSTEMROOT}/system32/msvcr71d.dll                     DESTINATION bin/ )
104    INSTALL( FILES ${PROJECT_BINARY_DIR}/relwithdebinfo//crea.dll          DESTINATION bin/ )
105    INSTALL( FILES ${PROJECT_BINARY_DIR}/relwithdebinfo//sqlite3.dll       DESTINATION bin/ )
106
107   #VTK dlls
108   #GDCM dlls
109   #WXWIDGETS dlls
110   IF(USE_VTK)
111     FILE(GLOB LST_FILE_VTKDLL "${ADDITIONAL_DLL_PATH}/*.dll")
112     FOREACH( iLST  ${LST_FILE_VTKDLL} )
113        INSTALL( 
114          FILES ${iLST}
115          DESTINATION bin/
116       )
117     ENDFOREACH(iLST)
118   ENDIF(USE_VTK)
119     
120  IF(USE_BOOST)
121          INSTALL( FILES  ${Boost_INCLUDE_DIR}/lib/boost_date_time-vc71-mt-1_38.dll   DESTINATION bin/ )
122          INSTALL( FILES  ${Boost_INCLUDE_DIR}/lib/boost_filesystem-vc71-mt-1_38.dll  DESTINATION bin/ )
123          INSTALL( FILES  ${Boost_INCLUDE_DIR}/lib/boost_iostreams-vc71-mt-1_38.dll   DESTINATION bin/ )
124          INSTALL( FILES  ${Boost_INCLUDE_DIR}/lib/boost_signals-vc71-mt-1_38.dll     DESTINATION bin/ )
125          INSTALL( FILES  ${Boost_INCLUDE_DIR}/lib/boost_thread-vc71-mt-1_38.dll      DESTINATION bin/ )
126  ENDIF(USE_BOOST)
127   
128 ENDIF(WIN32)
129
130 ENDIF (BUILD_STANDALONE_INSTALLER)
131
132
133