]> Creatis software - creaTools.git/blob - install/CMakeLists.txt
*** empty log message ***
[creaTools.git] / install / CMakeLists.txt
1
2
3
4
5
6 #-----------------------------------------------------------------------------
7 # CPACK+NSIS PACKAGING
8 #-----------------------------------------------------------------------------
9
10 #---Documentation-------------
11 #http://www.cmake.org/Wiki/CMake:Packaging_With_CPack
12 #http://www.cmake.org/Wiki/CMake:CPackConfiguration
13 #http://www.cmake.org/Wiki/CMake:Install_Commands
14
15
16 INCLUDE(InstallRequiredSystemLibraries)
17
18 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} - CREATIS")
19 SET(CPACK_PACKAGE_VENDOR "CREATIS")
20 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.txt")
21 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
22 SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
23 SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_MINOR_VERSION})
24 SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_BUILD_VERSION})
25
26
27
28
29
30 #  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools\\\\${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
31   SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
32   IF(WIN32)
33     SET(CMAKE_INSTALL_PREFIX C:/CreaTools/creatools_Installer_NormalUser)
34   ENDIF(WIN32)
35
36
37
38
39
40 IF(WIN32 AND NOT UNIX)
41   # There is a bug in NSI that does not handle full unix paths properly. Make
42   # sure there is at least one set of four (4) backlasshes.
43 #EED  SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/kernel/install/gnome/bbi-icon2.bmp")
44 #  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin/BBI_EXE.exe")
45   SET(CPACK_NSIS_DISPLAY_NAME "creatools_Installer_NormalUser")
46   SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
47   SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
48   SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr")
49   SET(CPACK_NSIS_MODIFY_PATH OFF)
50       
51   set  (MessageCreatoolsPath "CREATOOLS_SOURCE_PATH (bbtk, crea, creaMaracasVisu, ...)")
52   set  (CREATOOLS_SOURCE_PATH  "" CACHE PATH ${MessageCreatoolsPath} )
53   set  (CREATOOLS_DESTINATION_PATH ".")
54
55 #  set  (CREA_THIRDPARTY_DLLS           crea_ThirdParty_dlls-3.0.0)
56 #  set  (CREA_THIRDPARTY_LIBRARIES      crea_ThirdParty_Libraries-3.0.0)
57   set  (CREA_BASE                                       crea)
58   set  (CREA_BBTK                                       bbtk)
59   set  (CREA_MARACASVISU                        creaMaracasVisu)
60   set  (CREA_IMAGEIO                            creaImageIO)
61   set  (CREA_CONTOURS                           creaContours)
62   set  (CREA_ENVIRIONMENT                       creaEnvironment)
63   set  (CREA_RECALAGE                           creaRigidRegistration)
64   set  (CREA_BRUKER                                     creaBruker)
65   set  (CREA_BBTKGEDITOR                        bbtkGEditor)
66 #  set  (CREA_IRM                                       creaIRM-1.0.1)
67   
68 #  set  (CREA_BOOST_LYBRARY     "boost-1.40.0")
69 #  set  (CREA_GDCM_LYBRARY      "gdcm110909")
70 #  set  (CREA_ITK_LYBRARY       "itk-3.14.0")
71 #  set  (CREA_QT_LYBRARY        "Qt4.5.2")
72 #  set  (CREA_VTK_LYBRARY       "vtk-5.4.2")  
73 #  set  (CREA_WXWIN_LYBRARY     "wxWidgets-2.8.10")  
74
75   
76   IF(NOT CREATOOLS_SOURCE_PATH)
77     MESSAGE(FATAL_ERROR "${MessageCreatoolsPath}  not found")
78   ENDIF(NOT CREATOOLS_SOURCE_PATH)
79   
80         
81 #       SET(TTH_DIRBIN                                  "$INSTDIR\\\\bin\\\\tth")
82 #       SET(MIKTEX_INSTALL_DIRBIN               "$INSTDIR\\\\bin\\\\MikTex-2.7\\\\miktex\\\\bin")
83         SET(CREATOOLS_DIRBIN                    "$INSTDIR\\\\bin")
84         SET(CREA_DLLS_DIRBIN                    "$INSTDIR\\\\bin")
85         SET(CREA_BASE_DIRBIN                    "$INSTDIR\\\\${CREA_BASE}\\\\bin")
86         SET(CREA_BBTK_DIRBIN                    "$INSTDIR\\\\${CREA_BBTK}\\\\bin")
87         SET(CREA_MARACASVISU_DIRBIN     "$INSTDIR\\\\${CREA_MARACASVISU}\\\\bin")
88         SET(CREA_IMAGEIO_DIRBIN                 "$INSTDIR\\\\${CREA_IMAGEIO}\\\\bin")
89         SET(CREA_CONTOURS_DIRBIN                "$INSTDIR\\\\${CREA_CONTOURS}\\\\bin")
90         SET(CREA_ENVIRIONMENT_DIRBIN    "$INSTDIR\\\\${CREA_ENVIRIONMENT}\\\\bin")
91         SET(CREA_RECALAGE_DIRBIN                "$INSTDIR\\\\${CREA_RECALAGE}\\\\bin")
92         SET(CREA_BBTKGEDITOR_DIRBIN             "$INSTDIR\\\\${CREA_BBTKGEDITOR}\\\\bin")
93         
94 ###     SET(CREATOOLS_DIRS "${CREA_DLLS_DIRBIN};${MIKTEX_INSTALL_DIRBIN}")  
95         SET(CREATOOLS_DIRS "${CREATOOLS_DIRBIN}")
96   
97   
98    SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS  "
99    
100            !define Install_ReadEnvStr_RegKey 'HKCU \\\"Environment\\\"'
101                 ReadRegStr $0 \\\${Install_ReadEnvStr_RegKey} 'PATH'
102                 
103                 Push '$0;'
104                 Push '%CREATOOLS_DIRS%'
105                 Call StrStr
106                 Pop $2
107                 StrCmp $2 '' '' AddToPath_doneEED
108         StrCpy $0 \\\"$0;%CREATOOLS_DIRS%\\\"
109         WriteRegExpandStr \\\${Install_ReadEnvStr_RegKey} 'PATH' $0
110                 
111                 AddToPath_doneEED:
112                 SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 'STR:Environment' /TIMEOUT=5000 
113
114                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\CreaTools_HomePage.lnk' '${CREATOOLS_DIRBIN}\\\\start.bat'  'www.creatis.insa-lyon.fr/site/creatools'
115                 CreateDirectory '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools'
116                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools\\\\creaNewProject.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'creaNewProject.exe'
117                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools\\\\bbStudio.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbStudio.exe'
118                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools\\\\bbEditor.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbEditor.exe'
119                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools\\\\bbi.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbi.exe'
120                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Developer_Tools\\\\Readme.txt.lnk' '${CREATOOLS_DIRBIN}\\\\start.bat'  'bin\\\\data\\\\README_DeveloperTools.txt'
121                 CreateDirectory '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Demos'
122                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Demos\\\\Filter01.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbi.exe demo\\\\appli\\\\demoFiltering1.bbs'
123                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Demos\\\\Viewing01.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat' 'bbi.exe demo\\\\appli\\\\demoViewing1.bbs'
124                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Demos\\\\ShowNPoints.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat' 'bbi.exe bbs\\\\creaMaracasVisu\\\\appli\\\\ExampleShowNPoints.bbs'
125                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Demos\\\\Readme.txt.lnk' '${CREATOOLS_DIRBIN}\\\\start.bat'  'bin\\\\data\\\\README_Demos.txt'
126                 CreateDirectory '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Image_Tools'
127                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Image_Tools\\\\RigidRegistration.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbi.exe bbs\\\\PackRecalage\\\\appli\\\\Recalage.bbs'
128                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Image_Tools\\\\RenderingViewing.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'bbi.exe bbs\\\\creaMaracasVisu\\\\appli\\\\ExampleRenderingViewer.bbs'
129                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Image_Tools\\\\Contours.lnk' '${CREATOOLS_DIRBIN}\\\\creatis_AppGeneralPath.bat'  'wxContourGUIExample.exe'
130                 CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Image_Tools\\\\Readme.txt.lnk' '${CREATOOLS_DIRBIN}\\\\start.bat'  'bin\\\\data\\\\README_ImageTools.txt'
131
132                 WriteRegStr HKLM 'SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment' 'CREATOOLS_DIRS' '${CREATOOLS_DIRS}'
133                                 
134                 SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 'STR:Environment' /TIMEOUT=5000        
135                 
136                 SetShellVarContext current
137                 StrCpy $R0 \\\"$DOCUMENTS\\\\..\\\\.bbtk\\\\doc\\\"
138                 RMDir /r $R0
139
140    ")
141                 
142         SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS  "
143         
144         
145                 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
146                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\CreaTools_HomePage.lnk'
147                 
148                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\creaNewProject.lnk'
149                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\bbStudio.lnk'
150                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\bbEditor.lnk'
151                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\bbi.lnk'
152                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\Readme.txt.lnk'
153                 
154                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Demos\\\\Filter01.lnk'
155                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Demos\\\\Viewing01.lnk'
156                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Demos\\\\ShowNPoints.lnk'
157                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Demos\\\\Readme.txt.lnk'
158
159                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Image_Tools\\\\RigidRegistration.lnk'
160                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Image_Tools\\\\RenderingViewing.lnk'
161                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Image_Tools\\\\Contours.lnk'
162                 Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Image_Tools\\\\Readme.txt.lnk'
163
164         StrCpy $MUI_TEMP '$SMPROGRAMS\\\\$MUI_TEMP'
165                 RMDir /r $MUI_TEMP
166                 
167                 !define Uninstall_EnvStr_RegKey 'HKLM \\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"'                 
168                 WriteRegExpandStr \\\${Uninstall_EnvStr_RegKey} 'CREATOOLS_DIRS' ''             
169                 SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 'STR:Environment' /TIMEOUT=5000 
170                 
171                 SetShellVarContext current
172                 StrCpy $R0 \\\"$DOCUMENTS\\\\..\\\\.bbtk\\\\doc\\\"
173                 RMDir /r $R0
174                 
175         ")
176    
177    
178    
179
180
181 ELSE(WIN32 AND NOT UNIX)
182   SET(CPACK_STRIP_FILES "${CREA_BBTK}\\\\ubs.bat;kkk.rrr")
183   SET(CPACK_SOURCE_STRIP_FILES "")
184 ENDIF(WIN32 AND NOT UNIX)
185
186 #EED 20 Nov 2009
187 #SET(CPACK_PACKAGE_EXECUTABLES "bbStudio" "creatisStudio"
188 #                                                         "bbi" "creatisInterpreter"
189 #                                                         "IRMMain" "creatisCartography"
190 #                                                         "creaNewProject" "creatisNewProyect" )
191
192
193 INCLUDE(CPack)
194
195
196 # Aditional INSTALL for CPACK mecanism.
197 IF (WIN32)
198
199 #INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_THIRDPARTY_DLLS}\\\\bin/                  DESTINATION "${CREATOOLS_DESTINATION_PATH}/bin" )
200 #INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_THIRDPARTY_LIBRARIES}\\\\Library/         DESTINATION ${CREATOOLS_DESTINATION_PATH} )
201
202 INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/bin/                                                    DESTINATION bin  )
203 INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/data/                                                   DESTINATION bin/data  )
204 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_BASE}/                     DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
205 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_BBTK}/                     DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
206 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_IMAGEIO}/                  DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
207 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_MARACASVISU}/              DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
208 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_CONTOURS}/                 DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
209 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_ENVIRIONMENT}/     DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
210 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_RECALAGE}/                 DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
211 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_BRUKER}/                   DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
212 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_BBTKGEDITOR}/              DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
213 #INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_IRM}/                     DESTINATION ${CREATOOLS_DESTINATION_PATH}  )
214 ENDIF (WIN32)
215
216
217