Commit: abd54f1ed2a5706a394e31ef00f89dee19d55e87
Author: lazydodo
Date:   Tue Sep 6 07:21:23 2016 -0600
Branches: master
https://developer.blender.org/rBabd54f1ed2a5706a394e31ef00f89dee19d55e87

[cmake/cpack] allow override of package name

Cpack generates a standard filename with git information in it, which might not 
always be wanted for release builds, this patch adds an option to override that 
default filename.

Reviewers: sergey, juicyfruit

Reviewed By: juicyfruit

Differential Revision: https://developer.blender.org/D2199

===================================================================

M       CMakeLists.txt
M       build_files/cmake/packaging.cmake

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 709f824..5f7d59a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,8 @@ if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
 endif()
 set(BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date 
for reproducable builds (empty string disables this option)")
 set(BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time 
for reproducable builds (empty string disables this option)")
+set(PACKAGENAME_OVERRIDE "" CACHE STRING "Use instead of the standard 
packagename (empty string disables this option)")
+mark_as_advanced(PACKAGENAME_OVERRIDE)
 mark_as_advanced(BUILDINFO_OVERRIDE_DATE)
 mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
 
diff --git a/build_files/cmake/packaging.cmake 
b/build_files/cmake/packaging.cmake
index bc1d64f..1563331 100644
--- a/build_files/cmake/packaging.cmake
+++ b/build_files/cmake/packaging.cmake
@@ -48,7 +48,11 @@ else(MSVC)
        set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
 endif()
 
-set(CPACK_PACKAGE_FILE_NAME 
${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${PACKAGE_ARCH})
+if (CPACK_OVERRIDE_PACKAGENAME)
+       set(CPACK_PACKAGE_FILE_NAME 
${CPACK_OVERRIDE_PACKAGENAME}-${PACKAGE_ARCH})
+else()
+       set(CPACK_PACKAGE_FILE_NAME 
${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${PACKAGE_ARCH})
+endif()
 
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
        # RPM packages

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to