forked from PlusToolkit/PlusApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCPackConfig.cmake
153 lines (130 loc) · 6.24 KB
/
CPackConfig.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
INCLUDE(InstallRequiredSystemLibraries)
IF("${PLUSAPP_PACKAGE_EDITION}" STREQUAL "")
SET(PLUSAPP_PACKAGE_EDITION_PLATFORM "${PLUSLIB_PLATFORM}")
ELSE()
SET(PLUSAPP_PACKAGE_EDITION_PLATFORM "${PLUSAPP_PACKAGE_EDITION}-${PLUSLIB_PLATFORM}")
ENDIF()
SET(CPACK_GENERATOR "NSIS;ZIP")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plus(Public software Library for UltraSound) for ${PLUSAPP_PACKAGE_EDITION_PLATFORM}")
SET(CPACK_PACKAGE_VENDOR "PerkLab, Queen's University")
# SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${PLUSLIB_SOURCE_DIR}/src/License.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PLUSAPP_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${PLUSAPP_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PLUSAPP_VERSION_PATCH})
SET(CPACK_NSIS_PACKAGE_NAME "Plus Applications ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${PLUSAPP_COMMIT_DATE} (${PLUSAPP_PACKAGE_EDITION_PLATFORM})" )
SET(CPACK_PACKAGE_FILE_NAME "PlusApp-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${PLUSAPP_COMMIT_DATE_NO_DASHES}-${PLUSAPP_PACKAGE_EDITION_PLATFORM}" )
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_FILE_NAME}")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${PlusApp_BINARY_DIR};PlusApp;ALL;/")
# Install into c:\Users\<username>\PlusApp_...
SET(CPACK_NSIS_INSTALL_ROOT "$PROFILE")
# Do not ask for admin access rights(no UAC dialog), to allow installation without admin access
SET(CPACK_NSIS_DEFINES ${CPACK_NSIS_DEFINES} "RequestExecutionLevel user")
SET(CPACK_PACKAGE_EXECUTABLES
"PlusServerLauncher" "Plus Server Launcher"
"fCal" "Free-hand calibration(fCal)"
)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS)
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS)
IF(WIN32)
# Windows users may not be familiar how to open a command prompt, so create a shortcut for that
LIST(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Plus command prompt.lnk\\\" \\\"$INSTDIR\\\\bin\\\\StartPlusCommandPrompt.bat\\\" \\\"$INSTDIR\\\\bin\\\\StartPlusCommandPrompt.bat\\\" \\\"$INSTDIR\\\\bin\\\\StartPlusCommandPrompt.ico\\\"
")
LIST(APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Plus command prompt.lnk\\\"
")
IF(BUILD_DOCUMENTATION)
# Create a shortcut to documentation as well
LIST(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Plus user manual.lnk\\\" \\\"$INSTDIR\\\\doc\\\\PlusApp-UserManual.chm\\\"
")
LIST(APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Plus user manual.lnk\\\"
")
ENDIF()
ENDIF()
IF(EXISTS "${PLUSLIB_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${PLUSLIB_DIR};PlusLib;RuntimeExecutables;/")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${PLUSLIB_DIR};PlusLib;RuntimeLibraries;/")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${PLUSLIB_DIR};PlusLib;Scripts;/")
ELSE()
MESSAGE(WARNING "Unable to set PLUSLIB_DIR for package generation!")
ENDIF()
IF(EXISTS "${VTK_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${VTK_DIR};VTK;RuntimeLibraries;/")
ELSE()
MESSAGE(WARNING "Unable to set VTK_DIR for package generation!")
ENDIF()
IF(EXISTS "${ITK_DIR}/CMakeCache.txt")
SET(ITK_USE_REVIEW OFF)
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${ITK_DIR};ITK;RuntimeLibraries;/")
ELSE()
MESSAGE(WARNING "Unable to set ITK_DIR for package generation!")
ENDIF()
IF(PLUS_USE_OpenIGTLink)
IF(EXISTS "${OpenIGTLink_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${OpenIGTLink_DIR};OpenIGTLink;RuntimeLibraries;/")
ELSE()
MESSAGE(WARNING "Unable to set OpenIGTLink_DIR for package generation!")
ENDIF()
IF(EXISTS "${OpenIGTLinkIO_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${OpenIGTLinkIO_DIR};OpenIGTLinkIO;RuntimeLibraries;/")
ELSE()
MESSAGE(WARNING "Unable to set OpenIGTLinkIO_DIR for package generation!")
ENDIF()
ENDIF()
IF(PLUS_USE_OvrvisionPro)
IF(EXISTS "${OvrvisionPro_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${OvrvisionPro_DIR};OvrvisionPro;RuntimeLibraries;/")
ELSE()
MESSAGE(WARNING "Unable to set OvrvisionPro_DIR for package generation!")
ENDIF()
IF(EXISTS "${OpenCV_DIR}/CMakeCache.txt")
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${OpenCV_DIR};OpenCV;libs;/")
ELSE()
MESSAGE(WARNING "Unable to set OpenCV_DIR for package generation!")
ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
# Installation vars.
# PLUSAPP_INSTALL_BIN_DIR - binary dir(executables)
# PLUSAPP_INSTALL_LIB_DIR - library dir(libs)
# PLUSAPP_INSTALL_DATA_DIR - share dir(say, examples, data, etc)
# PLUSAPP_INSTALL_CONFIG_DIR - config dir(configuration files)
# PLUSAPP_INSTALL_SCRIPTS_DIR - scripts dir
# PLUSAPP_INSTALL_INCLUDE_DIR - include dir(headers)
# PLUSAPP_INSTALL_PACKAGE_DIR - package/export configuration files
# PLUSAPP_INSTALL_NO_DEVELOPMENT - do not install development files
# PLUSAPP_INSTALL_NO_RUNTIME - do not install runtime files
# PLUSAPP_INSTALL_NO_DOCUMENTATION - do not install documentation files
# Applications
# RuntimeLibraries
# Development
IF(NOT PLUSAPP_INSTALL_BIN_DIR)
SET(PLUSAPP_INSTALL_BIN_DIR "bin")
ENDIF()
IF(NOT PLUSAPP_INSTALL_LIB_DIR)
SET(PLUSAPP_INSTALL_LIB_DIR "lib")
ENDIF()
IF(NOT PLUSAPP_INSTALL_DATA_DIR)
SET(PLUSAPP_INSTALL_DATA_DIR "data")
ENDIF()
IF(NOT PLUSAPP_INSTALL_CONFIG_DIR)
SET(PLUSAPP_INSTALL_CONFIG_DIR "config")
ENDIF()
IF(NOT PLUSAPP_INSTALL_SCRIPTS_DIR)
SET(PLUSAPP_INSTALL_SCRIPTS_DIR "scripts")
ENDIF()
IF(NOT PLUSAPP_INSTALL_INCLUDE_DIR)
SET(PLUSAPP_INSTALL_INCLUDE_DIR "include")
ENDIF()
IF(NOT PLUSAPP_INSTALL_DOCUMENTATION_DIR)
SET(PLUSAPP_INSTALL_DOCUMENTATION_DIR "doc")
ENDIF()
IF(NOT PLUSAPP_INSTALL_NO_DOCUMENTATION)
SET(PLUSAPP_INSTALL_NO_DOCUMENTATION 0)
ENDIF()
INCLUDE(CPack)