CPack packaging support from Dan Eicher, tested to build redhat RPM's, a Mac bundle...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Feb 2011 18:33:05 +0000 (18:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Feb 2011 18:33:05 +0000 (18:33 +0000)
CMakeLists.txt
build_files/cmake/RpmBuild.cmake [new file with mode: 0644]
build_files/cmake/packaging.cmake [new file with mode: 0644]

index 3b2df0570ecdbb70a78118eb94caa6b36c0d7608..349bbe23ac0a6d7aa341efd2d564d69edc4f4683 100644 (file)
@@ -1061,3 +1061,7 @@ add_subdirectory(source/creator)
 if(WITH_PLAYER)
        add_subdirectory(source/blenderplayer)
 endif()
+
+#-----------------------------------------------------------------------------
+# CPack for generating packages
+include(build_files/cmake/packaging.cmake)
diff --git a/build_files/cmake/RpmBuild.cmake b/build_files/cmake/RpmBuild.cmake
new file mode 100644 (file)
index 0000000..19943fd
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# VLMC RPM Finder
+# Authors: Rohit Yadav <rohityadav89@gmail.com>
+#
+
+find_program(RPMBUILD
+    NAMES rpmbuild
+    PATHS "/usr/bin")
+
+if ( RPMBUILD )
+    get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
+    message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
+    set(RPMBUILD_FOUND "YES")
+else ( RPMBUILD ) 
+    message(STATUS "rpmbuild NOT found. RPM generation will not be available")
+    set(RPMBUILD_FOUND "NO")
+endif ( RPMBUILD )
+#
+# VLMC RPM Finder
+# Authors: Rohit Yadav <rohityadav89@gmail.com>
+#
+
+find_program(RPMBUILD
+    NAMES rpmbuild
+    PATHS "/usr/bin")
+
+if ( RPMBUILD )
+    get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
+    message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
+    set(RPMBUILD_FOUND "YES")
+else ( RPMBUILD ) 
+    message(STATUS "rpmbuild NOT found. RPM generation will not be available")
+    set(RPMBUILD_FOUND "NO")
+endif ( RPMBUILD )
diff --git a/build_files/cmake/packaging.cmake b/build_files/cmake/packaging.cmake
new file mode 100644 (file)
index 0000000..be2d4d7
--- /dev/null
@@ -0,0 +1,40 @@
+set(PROJECT_DESCRIPTION  "Blender is a very fast and versatile 3D modeller/renderer.")
+set(PROJECT_COPYRIGHT    "Copyright (C) 2001-2011 Blender Foundation")
+set(PROJECT_CONTACT      "foundation@blender.org")
+set(PROJECT_VENDOR       "Blender Foundation")
+set(ORG_WEBSITE          "www.blender.org")
+
+set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
+set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_NAME_LONG})
+set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
+set(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Force Package Name
+set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+
+# RPM packages
+include(build_files/cmake/RpmBuild.cmake)
+if(RPMBUILD_FOUND AND NOT WIN32)
+    set(CPACK_GENERATOR "RPM")
+    set(CPACK_SET_DESTDIR TRUE)
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
+endif(RPMBUILD_FOUND AND NOT WIN32)
+
+# Mac Bundle
+if(APPLE)
+    set(CPACK_GENERATOR "DragNDrop")
+
+    #Libraries are bundled directly
+    set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
+
+    # Bundle Properties
+    set(MACOSX_BUNDLE_BUNDLE_NAME blender)
+    set(MACOSX_BUNDLE_BUNDLE_VERSION ${BLENDER_VERSION})
+    set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION})
+    set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${BLENDER_VERSION}-r${BUILD_REV}")
+endif(APPLE)
+
+set(CPACK_PACKAGE_EXECUTABLES "blender")
+include(CPack)