ENH: Give Mac installers package relocation capability. Default location is still the same for backwards compatibility, but packages will now be relocatable by default like they are on Windows via the NSIS installer. New CPack variables for controlling this functionality are CPACK_PACKAGE_DEFAULT_LOCATION and CPACK_PACKAGE_RELOCATABLE.

This commit is contained in:
David Cole 2007-12-26 16:57:13 -05:00
parent ad788fe4c8
commit 764f6838a7
3 changed files with 15 additions and 2 deletions

View File

@ -34,3 +34,7 @@ if(CPACK_GENERATOR MATCHES "CygwinSource")
SET(CPACK_SOURCE_IGNORE_FILES
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource")
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")

View File

@ -12,7 +12,7 @@
<key>IFPkgFlagAuthorizationAction</key>
<string>AdminAuthorization</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<string>@CPACK_PACKAGE_DEFAULT_LOCATION@</string>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
@ -20,7 +20,7 @@
<key>IFPkgFlagOverwritePermissions</key>
<true/>
<key>IFPkgFlagRelocatable</key>
<false/>
<@CPACK_PACKAGE_RELOCATABLE@/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>

View File

@ -78,6 +78,15 @@ cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
"${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
"${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
# always force to exactly "true" or "false" for CPack.Info.plist.in:
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_PACKAGE_RELOCATABLE "true")
else(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_PACKAGE_RELOCATABLE "false")
endif(CPACK_PACKAGE_RELOCATABLE)
macro(cpack_check_file_exists file description)
if(NOT EXISTS "${file}")