From ba5dbde1ea69648d321018c0153d24d3600a751d Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Tue, 10 Mar 2015 13:32:43 +0100 Subject: [PATCH] Build distributable packages with CPack --- CMakeLists.txt | 2 ++ cmake/package.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 cmake/package.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f7f328..ef7fc5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ endif() ## 2. Build Monicelli +include(package) + add_subdirectory(src) install(FILES README.md LICENSE.txt DESTINATION doc/) diff --git a/cmake/package.cmake b/cmake/package.cmake new file mode 100644 index 0000000..747141f --- /dev/null +++ b/cmake/package.cmake @@ -0,0 +1,42 @@ +# +# Monicelli: an esoteric language compiler +# +# Copyright (C) 2014 Stefano Sanfilippo +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(InstallRequiredSystemLibraries) + +set(CPACK_GENERATOR "TGZ;DEB;RPM;ZIP") + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "Monicelli: an esoteric programming language, come se fosse antani." +) +set(CPACK_PACKAGE_VENDOR "Stefano Sanfilippo") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Stefano Sanfilippo") + +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") + +set(CPACK_PACKAGE_VERSION_MAJOR "1") +set(CPACK_PACKAGE_VERSION_MINOR "0") +set(CPACK_PACKAGE_VERSION_PATCH "0") + +set(CPACK_PACKAGE_INSTALL_DIRECTORY + "monicelli-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" +) + +include(CPack) +