[vlmc-devel] commit: CMakeLists.txt: Adds git rev as patch version, also appends in packages (Rohit Yadav )

git at videolan.org git at videolan.org
Sat Sep 25 02:41:58 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Sat Sep 25 06:16:41 2010 +0530| [e2e8f156013e0b4bff330ea4b1c20c7d7d0ae5b4] | committer: Rohit Yadav 

CMakeLists.txt: Adds git rev as patch version, also appends in packages
and adds processor name too (unix/deb/rpm only). Adds rpm pkg dependency,
which is common to deb pkg too. Fixes typos and variables further used in config.h.
This should satisfy the git rev version as requested on irc.

vlmc.ico: Modified icon for windows; icon has multiple resolution
icons embedded: 256x256, 128x128, 64x64, 32x32, 16x16.
This fixes any resolution problem (viz #109) on any Windows version.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e2e8f156013e0b4bff330ea4b1c20c7d7d0ae5b4
---

 CMakeLists.txt      |   66 ++++++++++++++++++++++++++++++++------------------
 nsis/CMakeLists.txt |    2 +-
 share/vlmc.ico      |  Bin 67646 -> 353118 bytes
 3 files changed, 43 insertions(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e00856..3e0cb47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@
 #          Ludovic Fauvet <etix at vlmc.org>
 #
 
-#Project Info
+# Project Info
 SET(PROJECT_NAME_SHORT   "VLMC")
 SET(PROJECT_NAME_LONG    "VideoLAN Movie Creator")
 SET(PROJECT_DESCRIPTION  "VLMC (VideoLAN Movie Creator) is a cross-platform, non-linear video editing software based on the VLC Media Player.")
@@ -13,22 +13,36 @@ SET(PROJECT_CONTACT      "vlmc-devel at videolan.org")
 SET(PROJECT_VENDOR       "VLMC Team")
 SET(ORG_WEBSITE          "videolan.org")
 
-STRING(TOLOWER ${PROJECT_NAME_SHORT} PROJECT_NAME_SHORT_LOWER)
-PROJECT(${PROJECT_NAME_SHORT_LOWER}-${PROJECT_VERSION})
-
-# version: 0.2.0
+# Find Git Version Patch   
+FIND_PROGRAM(GIT git)
+IF(GIT)
+    EXECUTE_PROCESS(
+        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+        COMMAND ${GIT} rev-parse --short HEAD 
+        OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    SET(PROJECT_VERSION_PATCH "${GIT_OUT}git")
+    MESSAGE(STATUS "Git Version Patch: git_${GIT_OUT}")
+ELSE(GIT)
+    SET(GIT_OUT 0)
+ENDIF(GIT)
+
+# version: 0.2.x
 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
 SET(CPACK_PACKAGE_VERSION_MINOR "2")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
-SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-SET(PROJECT_VERSION ${COMPLETE_VERSION})
+SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+SET(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
+SET(PROJECT_VERSION ${CPACK_PACKAGE_VERSION})
+
+STRING(TOLOWER ${PROJECT_NAME_SHORT} PROJECT_NAME_SHORT_LOWER)
+PROJECT(${PROJECT_NAME_SHORT_LOWER}-${PROJECT_VERSION})
 
 # Codename of the Project :-)
 SET(CODENAME "alpha")
 
 # System Information
 SITE_NAME(HOSTNAME)
-SET(SYSNAME ${CMAKE_SYSTEM})
+SET(SYSNAME ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR})
 
 # CMake Settings
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
@@ -79,7 +93,7 @@ ELSE(NOT APPLE)
     SET(WITH_CRASHHANDLER_GUI FALSE CACHE BOOL "Disable crash handler gui...")
     SET(WITH_CRASHHANDLER False CACHE BOOL "Disable the crash handler")
     SET(CMAKE_BUILD_TYPE "Release")
-    SET(CMAKE_OSX_ARCHITECTURES i386) # Make a universal binary
+    SET(CMAKE_OSX_ARCHITECTURES i386)
 #   SET(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}")
 ENDIF(NOT APPLE)
 
@@ -205,23 +219,25 @@ INSTALL (DIRECTORY share/ DESTINATION ${VLMC_DATA_DIR}
          PATTERN "vlmc.png" EXCLUDE)
 
 #############################################################
-# Enable packaging
+# Package Settings
 
 INCLUDE(InstallRequiredSystemLibraries)
 
 SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME_SHORT})
-SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
-# Force package name
-SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME})
 SET(CPACK_PACKAGE_DESCRIPTION ${PROJECT_NAME_LONG})
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME_SHORT} \n ${PROJECT_DESCRIPTION}")
 SET(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
 SET(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
+SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README)
+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}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+
+# NSIS Windows Installer
 IF(WIN32 AND NOT UNIX)
     # There is a bug in NSI that does not handle full unix paths properly. Make
     # sure there is at least one set of four (4) backslashes.
@@ -232,29 +248,31 @@ IF(WIN32 AND NOT UNIX)
     SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\vlmc.org")
     SET(CPACK_NSIS_CONTACT ${PROJECT_CONTACT})
     SET(CPACK_NSIS_MODIFY_PATH ON)
-    #SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "  !include \\\"${CMAKE_SOURCE_DIR}\\\\win_build\\\\extra.nsh\\\"")
 ELSE(WIN32 AND NOT UNIX)
     #SET(CPACK_STRIP_FILES "VLMC")
     #SET(CPACK_SOURCE_STRIP_FILES "")
 ENDIF(WIN32 AND NOT UNIX)
 
+# TODO: Check stuff: libvlc2 etc. in future as VLC 1.1+ releases
+SET(PACKAGE_REQUIRES "libqt4-gui ( >= 4.6 ), libqt4-network ( >= 4.6 ), libqt4-svg ( >= 4.6 ), libqt4-xml ( >= 4.6 ), frei0r-plugins-dev")
+
 # RPM packages
 INCLUDE ( ${CMAKE_MODULE_PATH}/RpmBuild.cmake )
-IF ( RPMBUILD_FOUND )
+IF ( RPMBUILD_FOUND AND NOT WIN32 )
     SET(CPACK_GENERATOR "RPM")
     SET(CPACK_SET_DESTDIR TRUE)
-ENDIF ( RPMBUILD_FOUND )
+    SET(CPACK_RPM_PACKAGE_REQUIRES ${PACKAGE_REQUIRES})
+ENDIF ( RPMBUILD_FOUND AND NOT WIN32 )
 
 # Debian packages
 INCLUDE ( ${CMAKE_MODULE_PATH}/DpkgBuild.cmake )
-IF ( DPKG_FOUND )
+IF ( DPKG_FOUND AND NOT WIN32 )
     SET(CPACK_GENERATOR "DEB")
     SET(CPACK_SET_DESTDIR TRUE)
-    # FIXME: Check stuff: libvlc2 etc. in future as VLC 1.1+ releases
-    SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt4-gui ( >= 4.6 ), libqt4-network ( >= 4.6 ), libqt4-svg ( >= 4.6 ), libqt4-xml ( >= 4.6 ), frei0r-plugins-dev")
-ENDIF ( DPKG_FOUND )
+    SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_REQUIRES})
+ENDIF ( DPKG_FOUND AND NOT WIN32 )
 
-#Mac
+# Mac Bundle
 IF( APPLE )
     SET(CPACK_GENERATOR "DragNDrop")
 
diff --git a/nsis/CMakeLists.txt b/nsis/CMakeLists.txt
index 82761fc..bb8fb6a 100644
--- a/nsis/CMakeLists.txt
+++ b/nsis/CMakeLists.txt
@@ -4,7 +4,7 @@
 #
 
 # Output file name
-SET(NSIS_OUTPUT_FILE "${PROJECT_NAME}${PROJECT_VERSION}.exe")
+SET(NSIS_OUTPUT_FILE "${PROJECT_NAME}.exe")
 
 # NSIS is only available for Win32 builds (native or cross compilation)
 IF(WIN32)
diff --git a/share/vlmc.ico b/share/vlmc.ico
index 95c29b7..8c7c412 100644
Binary files a/share/vlmc.ico and b/share/vlmc.ico differ



More information about the Vlmc-devel mailing list