|
From: Markus R. <god...@us...> - 2009-11-26 08:12:23
|
Module: performous
Branch: master
Commit: 6a211f3778dcb876f6c5b59e88d21b1ca77b3c6a
Author: Markus Raab <un...@ma...>
Date: Thu Nov 26 09:11:25 2009 +0100
Packaging for plugin++ (Debian 5.*)
---
libs/plugin++/CMakeLists.txt | 2 +
libs/plugin++/cmake/plugin++-packaging.cmake | 61 ++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index fca339f..4d2e22c 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -10,6 +10,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles")
endif()
+include("${CMAKE_SOURCE_DIR}/cmake/plugin++-packaging.cmake")
+
# Add a sensible build type default and warning because empty means no optimization and no debug info.
if(NOT CMAKE_BUILD_TYPE)
message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.")
diff --git a/libs/plugin++/cmake/plugin++-packaging.cmake b/libs/plugin++/cmake/plugin++-packaging.cmake
new file mode 100644
index 0000000..c0c192a
--- /dev/null
+++ b/libs/plugin++/cmake/plugin++-packaging.cmake
@@ -0,0 +1,61 @@
+set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+set(CPACK_PACKAGE_VERSION "${Plugin++_VERSION}")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY " Plugin++ is a cross platform plug-in framework for C++ that uses XML to marshal data across the application and the shared library space.")
+set(CPACK_PACKAGE_CONTACT "http://sourceforge.net/projects/pluginpp/")
+set(CPACK_SOURCE_IGNORE_FILES
+ "/.cvsignore"
+ "/.gitignore"
+ "/songs/"
+ "/build/"
+ "/.svn/"
+ "/.git/"
+ "/osx-utils/"
+ "/portage-overlay/"
+)
+
+
+if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
+ set(CPACK_STRIP_FILES TRUE)
+endif("${CMAKE_BUILD_TYPE}" MATCHES "Release")
+
+
+if(UNIX)
+ # Try to find architecture
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
+ string(STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
+ # Try to find distro name and distro-specific arch
+ execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE LSB_ID)
+ execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE LSB_RELEASE)
+ string(STRIP "${LSB_ID}" LSB_ID)
+ string(STRIP "${LSB_RELEASE}" LSB_RELEASE)
+ set(LSB_DISTRIB "${LSB_ID}${LSB_RELEASE}")
+ if(NOT LSB_DISTRIB)
+ set(LSB_DISTRIB "unix")
+ endif(NOT LSB_DISTRIB)
+ # For Debian-based distros we want to create DEB packages.
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
+ set(CPACK_GENERATOR "DEB")
+ set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
+ set(CPACK_DEBIAN_PACKAGE_SECTION "universe/games")
+ set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "ultrastar-songs, ultrastar-songs-restricted, msttcorefonts")
+ # We need to alter the architecture names as per distro rules
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ set(CPACK_PACKAGE_ARCHITECTURE i386)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+ set(CPACK_PACKAGE_ARCHITECTURE amd64)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+ # Set the dependencies based on the distro version
+ if("${LSB_DISTRIB}" MATCHES "Debian5.*")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev, libc6-dev")
+ endif("${LSB_DISTRIB}" MATCHES "Debian5.*")
+ if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+ message("WARNING: ${LSB_DISTRIB} not supported yet.\nPlease set deps in cmake/performous-packaging.cmake before packaging.")
+ endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
+ set(CPACK_SYSTEM_NAME "${LSB_DISTRIB}-${CPACK_PACKAGE_ARCHITECTURE}")
+ message(STATUS "Detected ${CPACK_SYSTEM_NAME}. Use make package to build packages (${CPACK_GENERATOR}).")
+endif(UNIX)
+
+include(CPack)
+
|