recent changes to svn broke rpm builder, also include rpm version info
authorCampbell Barton <ideasman42@gmail.com>
Sat, 26 Feb 2011 06:27:54 +0000 (06:27 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 26 Feb 2011 06:27:54 +0000 (06:27 +0000)
build_files/cmake/macros.cmake
build_files/cmake/packaging.cmake

index 007c147ccef33be0762f4be07c4207ddfeda776b..ec55489e59e816209757e23f846fcec54cf80330 100644 (file)
@@ -366,5 +366,20 @@ macro(get_blender_version)
        set(BLENDER_VERSION_CHAR ${_out_version_char})
        set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
 
+       # for packaging, alpha to numbers
+       if(${BLENDER_VERSION_CHAR})
+               set(BLENDER_VERSION_CHAR_INDEX "0")
+       else()
+               set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w q y z)
+               list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
+               MATH(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
+               unset(_char_ls)
+               unset(_out_version_char_index)
+       endif()
+
+       unset(_out_subversion)
+       unset(_out_version_char)
+       unset(_out_version_cycle)
+
        # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
 endmacro()
index 0de5451d45f5b8d6fb89d9c72edd130c86992908..d3864e2fc1b8947c52778d1c71c2c6d783d12ab0 100644 (file)
@@ -4,12 +4,31 @@ set(PROJECT_CONTACT      "foundation@blender.org")
 set(PROJECT_VENDOR       "Blender Foundation")
 set(ORG_WEBSITE          "www.blender.org")
 
+set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
+set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
+set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX})
+
 set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
 set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
 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}")
+SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
+SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
+SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
+
+
+# Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
+include(FindSubversion)
+set(MY_WC_REVISION "unknown")
+if(EXISTS ${CMAKE_SOURCE_DIR}/.svn/)
+       if(Subversion_FOUND)
+               Subversion_WC_INFO(${CMAKE_SOURCE_DIR} MY)
+       endif()
+endif()
+set(BUILD_REV ${MY_WC_REVISION})
+
 
 # Force Package Name
 set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
@@ -17,23 +36,25 @@ set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${C
 # 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)
+       set(CPACK_GENERATOR "RPM")
+       set(CPACK_SET_DESTDIR TRUE)
+       set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
+       set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
+       set(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
+endif()
 
 # Mac Bundle
 if(APPLE)
-    set(CPACK_GENERATOR "DragNDrop")
+       set(CPACK_GENERATOR "DragNDrop")
 
-    #Libraries are bundled directly
-    set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
+       # 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}")
+       # 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")