Merged changes in the trunk up to revision 35203.
[blender.git] / build_files / cmake / packaging.cmake
1 set(PROJECT_DESCRIPTION  "Blender is a very fast and versatile 3D modeller/renderer.")
2 set(PROJECT_COPYRIGHT    "Copyright (C) 2001-2011 Blender Foundation")
3 set(PROJECT_CONTACT      "foundation@blender.org")
4 set(PROJECT_VENDOR       "Blender Foundation")
5 set(ORG_WEBSITE          "www.blender.org")
6
7 set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
8 set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
9 set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX})
10
11 set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
12 set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
13 set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
14 set(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
15 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
16 set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
17 SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
18 SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
19 SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
20
21
22 # Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
23 include(FindSubversion)
24 set(MY_WC_REVISION "unknown")
25 if(EXISTS ${CMAKE_SOURCE_DIR}/.svn/)
26         if(Subversion_FOUND)
27                 Subversion_WC_INFO(${CMAKE_SOURCE_DIR} MY)
28         endif()
29 endif()
30 set(BUILD_REV ${MY_WC_REVISION})
31
32
33 # Force Package Name
34 set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
35
36 # RPM packages
37 include(build_files/cmake/RpmBuild.cmake)
38 if(RPMBUILD_FOUND AND NOT WIN32)
39         set(CPACK_GENERATOR "RPM")
40         set(CPACK_SET_DESTDIR TRUE)
41         set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
42         set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
43         set(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
44 endif()
45
46 # Mac Bundle
47 if(APPLE)
48         set(CPACK_GENERATOR "DragNDrop")
49
50         # Libraries are bundled directly
51         set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
52
53         # Bundle Properties
54         set(MACOSX_BUNDLE_BUNDLE_NAME blender)
55         set(MACOSX_BUNDLE_BUNDLE_VERSION ${BLENDER_VERSION})
56         set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION})
57         set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${BLENDER_VERSION}-r${BUILD_REV}")
58 endif(APPLE)
59
60 set(CPACK_PACKAGE_EXECUTABLES "blender")
61 include(CPack)