Permalink
Browse files

Add logic to properly encode platform and OS information in the packa…

…ge name.

Change-Id: I8808503ee6084fe89152c765db9fc8a3db13dde4
  • Loading branch information...
1 parent 8cae7f0 commit 9217c5fc9a9e382277f0375b947b99a827ffdda3 David Partyka committed Apr 22, 2011
Showing with 26 additions and 0 deletions.
  1. +26 −0 VTKCPack.cmake
View
@@ -16,6 +16,32 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
SET(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+
+ IF (CMAKE_SYSTEM_PROCESSOR MATCHES "unknown")
+ SET (CMAKE_SYSTEM_PROCESSOR "x86")
+ ENDIF (CMAKE_SYSTEM_PROCESSOR MATCHES "unknown")
+
+ IF(NOT DEFINED CPACK_SYSTEM_NAME)
+ SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+ ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
+
+ IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+ IF(CMAKE_CL_64)
+ SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
+ ELSE(CMAKE_CL_64)
+ SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
+ ENDIF(CMAKE_CL_64)
+ ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+
+ IF(${CPACK_SYSTEM_NAME} MATCHES Darwin AND CMAKE_OSX_ARCHITECTURES)
+ LIST(LENGTH CMAKE_OSX_ARCHITECTURES _length)
+ IF(_length GREATER 1)
+ SET(CPACK_SYSTEM_NAME Darwin-Universal)
+ ELSE(_length GREATER 1)
+ SET(CPACK_SYSTEM_NAME Darwin-${CMAKE_OSX_ARCHITECTURES})
+ ENDIF(_length GREATER 1)
+ ENDIF(${CPACK_SYSTEM_NAME} MATCHES Darwin AND CMAKE_OSX_ARCHITECTURES)
+
SET(CPACK_PACKAGE_VERSION_MAJOR "${VTK_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VTK_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VTK_BUILD_VERSION}")

0 comments on commit 9217c5f

Please sign in to comment.