WindowsNSIS.cmake 5.63 KB
Newer Older
Martyn Gigg's avatar
Martyn Gigg committed
1
2
###########################################################################
# CPack configuration for Windows using NSIS
3
4
###########################################################################

Martyn Gigg's avatar
Martyn Gigg committed
5
6
7
8
9
10
###########################################################################
# General settings
###########################################################################
set( CPACK_GENERATOR "NSIS" )
set( CPACK_INSTALL_PREFIX "/")
set( CPACK_PACKAGE_NAME "mantid${CPACK_PACKAGE_SUFFIX}" )
11
set( CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}" )
Martyn Gigg's avatar
Martyn Gigg committed
12
set( CPACK_NSIS_INSTALL_ROOT "C:")
13
# have the properly capitalsed name for the start menu and install folder
14
15
16
17
18
19
20
21
set( CPACK_NSIS_DISPLAY_NAME "Mantid${CPACK_PACKAGE_SUFFIX_CAMELCASE}")
set( CPACK_PACKAGE_INSTALL_DIRECTORY "Mantid${CPACK_PACKAGE_SUFFIX_CAMELCASE}Install")
# note: the PACKAGE icon uses PNG, the other two use ICO
set ( PACKAGE_IMAGES_DIR "${CMAKE_CURRENT_SOURCE_DIR}\\\\images")
set( PACKAGE_ICON_BASENAME "mantidplot${CPACK_PACKAGE_SUFFIX}" )
set( CPACK_PACKAGE_ICON "${PACKAGE_IMAGES_DIR}\\\\${PACKAGE_ICON_BASENAME}.png" )
set( CPACK_NSIS_MUI_ICON "${PACKAGE_IMAGES_DIR}\\\\${PACKAGE_ICON_BASENAME}.ico" )
set( CPACK_NSIS_MUI_UNIICON "${PACKAGE_IMAGES_DIR}\\\\${PACKAGE_ICON_BASENAME}.ico" )
22

Martyn Gigg's avatar
Martyn Gigg committed
23
24
25
26
###########################################################################
# Deployment type - currently only works for Release!
###########################################################################
set( WINDOWS_DEPLOYMENT_TYPE "Release" CACHE STRING "Type of deployment used")
27
set_property(CACHE WINDOWS_DEPLOYMENT_TYPE PROPERTY STRINGS Release)
Martyn Gigg's avatar
Martyn Gigg committed
28
mark_as_advanced(WINDOWS_DEPLOYMENT_TYPE)
29

Martyn Gigg's avatar
Martyn Gigg committed
30
31
32
33
###########################################################################
# External dependency DLLs
###########################################################################
set ( BOOST_DIST_DLLS
34
    boost_date_time-mt.dll
35
    boost_filesystem-mt.dll
36
    boost_python38-mt.dll
37
    boost_regex-mt.dll
38
    boost_serialization-mt.dll
39
    boost_system-mt.dll
Martyn Gigg's avatar
Martyn Gigg committed
40
)
41

Martyn Gigg's avatar
Martyn Gigg committed
42
43
44
set ( POCO_DIST_DLLS
    PocoCrypto64.dll
    PocoFoundation64.dll
Roman Tolchenov's avatar
Roman Tolchenov committed
45
    PocoJSON64.dll
Martyn Gigg's avatar
Martyn Gigg committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    PocoNet64.dll
    PocoNetSSL64.dll
    PocoUtil64.dll
    PocoXML64.dll
)
set ( OCC_DIST_DLLS
    TKBO.dll
    TKBRep.dll
    TKernel.dll
    TKG2d.dll
    TKG3d.dll
    TKGeomAlgo.dll
    TKGeomBase.dll
    TKMath.dll
    TKMesh.dll
    TKPrim.dll
    TKTopAlgo.dll
)
set ( MISC_CORE_DIST_DLLS
65
    gslcblas.dll
Martyn Gigg's avatar
Martyn Gigg committed
66
    gsl.dll
67
68
69
70
    hdf5_cpp.dll
    hdf5_hl_cpp.dll
    hdf5_hl.dll
    hdf5.dll
Martyn Gigg's avatar
Martyn Gigg committed
71
    jsoncpp.dll
72
    lib3mf.dll
Martyn Gigg's avatar
Martyn Gigg committed
73
74
75
    libeay32.dll
    libNeXus-0.dll
    libNeXusCPP-0.dll
76
77
    librdkafka.dll
    librdkafkacpp.dll
78
    muparser.dll
Martyn Gigg's avatar
Martyn Gigg committed
79
80
    ssleay32.dll
    szip.dll
Hahn, Steven's avatar
Hahn, Steven committed
81
82
83
84
    tbb.dll
    tbbmalloc.dll
    tbbmalloc_proxy.dll
    tbb_preview.dll
Martyn Gigg's avatar
Martyn Gigg committed
85
86
    zlib.dll
)
87

88
set ( BIN_DLLS ${BOOST_DIST_DLLS} ${POCO_DIST_DLLS} ${OCC_DIST_DLLS} ${MISC_CORE_DIST_DLLS} )
89
foreach( DLL ${BIN_DLLS} )
90
  install ( FILES ${THIRD_PARTY_DIR}/bin/${DLL} DESTINATION bin )
Martyn Gigg's avatar
Martyn Gigg committed
91
endforeach()
92

93
94
95
96
97
98
# NSIS variables for shortcuts
# NOTE: DO NOT REMOVE THE BLANK LINES IN THE CPACK_NSIS_CREATE_ICONS_EXTRA COMMANDS AS THEY ARE REQUIRED
set (CPACK_NSIS_CREATE_ICONS_EXTRA "")
set (CPACK_NSIS_DELETE_ICONS_EXTRA "")
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "")
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "")
99

100
101
102
# General package icon
install ( FILES "${PACKAGE_IMAGES_DIR}\\\\${PACKAGE_ICON_BASENAME}.ico" DESTINATION bin )
# python wrapper
103
104
install ( FILES ${PROJECT_BINARY_DIR}/mantidpython.bat.install DESTINATION bin RENAME mantidpython.bat )

105
106
107
108
109
# Notebook
set ( WINDOWS_NSIS_MANTIDNOTEBOOK_ICON_NAME "mantid_notebook${CPACK_PACKAGE_SUFFIX}")
set ( MANTIDNOTEBOOK_LINK_NAME "Mantid Notebook ${CPACK_PACKAGE_SUFFIX_CAMELCASE}.lnk" )
install ( FILES "${PACKAGE_IMAGES_DIR}\\\\${WINDOWS_NSIS_MANTIDNOTEBOOK_ICON_NAME}.ico" DESTINATION bin )
set ( CPACK_NSIS_CREATE_ICONS_EXTRA "
110
  CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${MANTIDNOTEBOOK_LINK_NAME}' '$INSTDIR\\\\bin\\\\mantidpython.bat' 'notebook --notebook-dir=%userprofile%' '$INSTDIR\\\\bin\\\\${WINDOWS_NSIS_MANTIDNOTEBOOK_ICON_NAME}.ico'
111
")
112
set (CPACK_NSIS_DELETE_ICONS_EXTRA "
113
  Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\${MANTIDNOTEBOOK_LINK_NAME}\\\"
114
")
115
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
116
  CreateShortCut '$DESKTOP\\\\${MANTIDNOTEBOOK_LINK_NAME}' '$INSTDIR\\\\bin\\\\mantidpython.bat' 'notebook --notebook-dir=%userprofile%' '$INSTDIR\\\\bin\\\\${WINDOWS_NSIS_MANTIDNOTEBOOK_ICON_NAME}.ico'
117
118
")
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
119
  Delete \\\"$DESKTOP\\\\${MANTIDNOTEBOOK_LINK_NAME}\\\"
120
")
121

122
123
124
125
126
127
# Workbench
if(ENABLE_WORKBENCH)
  include( WindowsNSISQt5 )
  set( WINDOWS_NSIS_MANTIDWORKBENCH_ICON_NAME "mantid_workbench${CPACK_PACKAGE_SUFFIX}" )
  install ( FILES "${PACKAGE_IMAGES_DIR}\\\\${WINDOWS_NSIS_MANTIDWORKBENCH_ICON_NAME}.ico" DESTINATION bin )
  set ( MANTIDWORKBENCH_LINK_NAME "Mantid Workbench ${CPACK_PACKAGE_SUFFIX_CAMELCASE}.lnk" )
128
  set (CPACK_NSIS_CREATE_ICONS_EXTRA "
129
    CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${MANTIDWORKBENCH_LINK_NAME}' '\\\"$INSTDIR\\\\bin\\\\MantidWorkbench.exe\\\"' '' '$INSTDIR\\\\bin\\\\${WINDOWS_NSIS_MANTIDWORKBENCH_ICON_NAME}.ico'
130
131
132
133
134
135
136
137

    ${CPACK_NSIS_CREATE_ICONS_EXTRA}
  ")
  set (CPACK_NSIS_DELETE_ICONS_EXTRA "
    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\${MANTIDWORKBENCH_LINK_NAME}\\\"
    ${CPACK_NSIS_DELETE_ICONS_EXTRA}
  ")
  set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
138
    CreateShortCut '$DESKTOP\\\\${MANTIDWORKBENCH_LINK_NAME}' '\\\"$INSTDIR\\\\bin\\\\MantidWorkbench.exe\\\"' '' '$INSTDIR\\\\bin\\\\${WINDOWS_NSIS_MANTIDWORKBENCH_ICON_NAME}.ico'
139
140
141
142
143
144
145

    ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
  ")
  set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
    Delete \\\"$DESKTOP\\\\${MANTIDWORKBENCH_LINK_NAME}\\\"
    ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
  ")
146
endif()