cmake: Use CPack to create the package. (Use `make package` or `cpack`). Should produ...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 7 Feb 2008 15:33:40 +0000 (15:33 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 7 Feb 2008 15:33:40 +0000 (15:33 +0000)
extras/buildsystem/cmake/CMakeLists/root_CMakeLists.txt
extras/buildsystem/cmake/include/config.cmake

index 71f232a..84d0a3f 100644 (file)
@@ -28,3 +28,22 @@ add_subdirectory(src)
 add_subdirectory(modules)
 add_subdirectory(po)
 
+# Enable CPack: Automatic package creation
+
+set(README "${CMAKE_CURRENT_SOURCE_DIR}/README")
+set(LICENCE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+
+if(APPLE)
+set(README "${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/README.MacOSX.rtf")
+set(LICENCE "") # FIXME: Mac OS X's Package Maker doesn't allow non .*
+endif(APPLE)
+
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VLC Media Player")
+set(CPACK_PACKAGE_VENDOR "VideoLAN Team")
+set(CPACK_PACKAGE_DESCRIPTION_FILE ${README})
+set(CPACK_RESOURCE_FILE_LICENSE ${LICENCE})
+set(CPACK_PACKAGE_VERSION_MAJOR "${VLC_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${VLC_VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_PATCH "${VLC_VERSION_PATCH}${VLC_VERSION_EXTRA}")
+
+include(CPack)
index e7c2e89..9d4e9fe 100644 (file)
@@ -11,6 +11,21 @@ include( ${CMAKE_SOURCE_DIR}/cmake/vlc_add_compile_flag.cmake )
 include( ${CMAKE_SOURCE_DIR}/cmake/vlc_check_type.cmake )
 include( ${CMAKE_SOURCE_DIR}/cmake/pkg_check_modules.cmake )
 
+###########################################################
+# VERSION
+###########################################################
+
+set(VLC_VERSION_MAJOR 0)
+set(VLC_VERSION_MINOR 9)
+set(VLC_VERSION_PATCH 0)
+set(VLC_VERSION_EXTRA "-svn")
+
+set(PACKAGE "vlc")
+set(PACKAGE_STRING "vlc")
+set(VERSION_MESSAGE "vlc-${VLC_VERSION_MAJOR}.${VLC_VERSION_MINOR}.${VLC_VERSION_PATCH}${VLC_VERSION_EXTRA}")
+set(COPYRIGHT_MESSAGE "Copyright © the VideoLAN team")
+set(COPYRIGHT_YEARS "2001-2008")
+
 ###########################################################
 # Options
 ###########################################################
@@ -187,7 +202,7 @@ if(APPLE)
 endif(APPLE)
 
 ###########################################################
-# version and info setup
+# info
 ###########################################################
 
 macro(command_to_configvar command var)
@@ -206,11 +221,6 @@ command_to_configvar( "${CMAKE_C_COMPILER} --version" VLC_COMPILER )
 command_to_configvar( "${CMAKE_C_COMPILER} --version" CONFIGURE_LINE )
 set( VLC_COMPILER "${CMAKE_C_COMPILER}" )
 
-set(PACKAGE "vlc")
-set(PACKAGE_STRING "vlc")
-set(VERSION_MESSAGE "vlc-0.9.0-svn")
-set(COPYRIGHT_MESSAGE "Copyright © the VideoLAN team")
-set(COPYRIGHT_YEARS "2001-2008")