summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-04 20:14:09 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-04 20:14:09 (GMT)
commit5358809a5c1010739923b3bec22a63ba4fe2f657 (patch)
tree44ad9fbf6e731063a13b9871ee7712c35446e8cc /Modules
parent0b40b42b0888857d770007bf7b7438f9291a67e5 (diff)
downloadCMake-5358809a5c1010739923b3bec22a63ba4fe2f657.zip
CMake-5358809a5c1010739923b3bec22a63ba4fe2f657.tar.gz
CMake-5358809a5c1010739923b3bec22a63ba4fe2f657.tar.bz2
ENH: More CPack stuff and fix zlib compression
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPack.Description.plist.in6
-rw-r--r--Modules/CPack.cmake48
-rw-r--r--Modules/NSIS.template.in20
3 files changed, 61 insertions, 13 deletions
diff --git a/Modules/CPack.Description.plist.in b/Modules/CPack.Description.plist.in
index 310eb68..3d11476 100644
--- a/Modules/CPack.Description.plist.in
+++ b/Modules/CPack.Description.plist.in
@@ -3,10 +3,10 @@
<plist version="1.4">
<dict>
<key>IFPkgDescriptionTitle</key>
- <string>@CPACK_PROJECT_NAME@</string>
+ <string>@CPACK_PACKAGE_NAME@</string>
<key>IFPkgDescriptionVersion</key>
- <string>@CPACK_PROJECT_VERSION@-@CPACK_PROJECT_VERSION_PATCH@</string>
+ <string>@CPACK_PACKAGE_VERSION@</string>
<key>IFPkgDescriptionDescription</key>
- <string>@CPACK_PROJECT_DESCRIPTION@</string>
+ <string>@CPACK_PACKAGE_DESCRIPTION@</string>
</dict>
</plist>
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
new file mode 100644
index 0000000..39c773c
--- /dev/null
+++ b/Modules/CPack.cmake
@@ -0,0 +1,48 @@
+# Pick a configuration file
+SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
+IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+ SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+
+# Macro for setting values if a user did not overwrite them
+MACRO(cpack_set_if_not_set name value)
+ IF(NOT "${name}")
+ SET(${name} "${value}")
+ ENDIF(NOT "${name}")
+ENDMACRO(cpack_set_if_not_set)
+
+# Set the package name
+cpack_set_if_not_set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
+cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0")
+cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1")
+cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1")
+cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity")
+cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} built using CMake")
+cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
+
+# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
+cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
+ "${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}")
+
+IF(NOT EXISTS "${CPACK_PACKAGE_DESCRIPTION_FILE}")
+ MESSAGE(SEND_ERROR "CPack package description file: \"${CPACK_PACKAGE_DESCRIPTION_FILE}\" could not be found.")
+ENDIF(NOT EXISTS "${CPACK_PACKAGE_DESCRIPTION_FILE}")
+
+# Pick a generator
+IF(NOT CPACK_GENERATOR)
+ IF(UNIX)
+ IF(APPLE)
+ SET(CPACK_GENERATOR "PackageMaker")
+ ELSE(APPLE)
+ SET(CPACK_GENERATOR "TGZ")
+ ENDIF(APPLE)
+ ELSE(UNIX)
+ SET(CPACK_GENERATOR "NSIS")
+ ENDIF(UNIX)
+ENDIF(NOT CPACK_GENERATOR)
+
+# Set some other variables
+SET(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
+SET(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}")
+
+CONFIGURE_FILE("${cpack_input_file}" "${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE)
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 4ede861..a0b3613 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -3,8 +3,8 @@
;--------------------------------
; You must define these values
- !define VERSION "@CPACK_PROJECT_VERSION@"
- !define PATCH "@CPACK_PROJECT_VERSION_PATCH@"
+ !define VERSION "@CPACK_PACKAGE_VERSION@"
+ !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@"
!define INST_DIR @CPACK_TEMPORARY_DIRECTORY@
;--------------------------------
@@ -19,7 +19,7 @@
!include "MUI.nsh"
;Default installation folder
- InstallDir "$PROGRAMFILES\@CPACK_PROJECT_NAME@ ${VERSION}"
+ InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_NAME@ ${VERSION}"
;--------------------------------
; determine admin versus local install
@@ -51,8 +51,8 @@ FunctionEnd
;General
;Name and file
- Name "@CPACK_PROJECT_NAME@ ${VERSION}"
- OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_PROJECT_NAME@-${VERSION}-${PATCH}-win32.exe"
+ Name "@CPACK_PACKAGE_NAME@ ${VERSION}"
+ OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_PACKAGE_NAME@-${VERSION}-${PATCH}-win32.exe"
;--------------------------------
;Interface Settings
@@ -303,7 +303,7 @@ FunctionEnd
;--------------------------------
; Define some macro setting for the gui
- !define MUI_HEADERIMAGE_BITMAP "@CPACK_PROJECT_ICON@"
+ !define MUI_HEADERIMAGE_BITMAP "@CPACK_PACKAGE_ICON@"
;--------------------------------
;Pages
@@ -312,7 +312,7 @@ FunctionEnd
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
- !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PROJECT_VENDOR@\@CPACK_PROJECT_NAME@ ${VERSION}"
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_NAME@ ${VERSION}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
@@ -349,7 +349,7 @@ Section "Dummy Section" SecDummy
@CPACK_NSIS_EXTRA_COMMANDS@
;Store installation folder
- WriteRegStr SHCTX "Software\@CPACK_PROJECT_VENDOR@\@CPACK_PROJECT_NAME@ ${VERSION}" "" $INSTDIR
+ WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_NAME@ ${VERSION}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
@@ -409,7 +409,7 @@ Section "Uninstall"
RMDir "$INSTDIR"
; Remove the registry entries.
- DeleteRegKey SHCTX "Software\@CPACK_PROJECT_VENDOR@\@CPACK_PROJECT_NAME@ ${VERSION}"
+ DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_NAME@ ${VERSION}"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
@@ -429,7 +429,7 @@ Section "Uninstall"
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
- DeleteRegKey /ifempty SHCTX "Software\@CPACK_PROJECT_VENDOR@\@CPACK_PROJECT_NAME@ ${VERSION}"
+ DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_NAME@ ${VERSION}"
Push $INSTDIR\bin
Call un.RemoveFromPath