#135: CMake file to build all packages

This commit is contained in:
Louis Rubet 2017-06-19 21:43:26 +02:00
parent 4bc33791d8
commit 3d21b1e5db
3 changed files with 30 additions and 19 deletions

View file

@ -16,6 +16,9 @@ set(RPN_DISPLAY_NAME "rpn")
set(RPN_URL_INFO_ABOUT "https://github.com/louisrubet/rpn") set(RPN_URL_INFO_ABOUT "https://github.com/louisrubet/rpn")
set(RPN_CONTACT "Louis Rubet <louis@rubet.fr>") set(RPN_CONTACT "Louis Rubet <louis@rubet.fr>")
set(RPN_FRIENDLY_STRING "rpn - Reverse Polish Notation language") set(RPN_FRIENDLY_STRING "rpn - Reverse Polish Notation language")
set(RPN_LICENSE "LGPLv3")
set(RPN_LICENSE_FILE "${PROJECT_SOURCE_DIR}/LICENSE")
set(RPN_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
# compiler options # compiler options
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
@ -45,15 +48,21 @@ target_link_libraries(rpn libgmp.a)
# install # install
install(TARGETS rpn DESTINATION bin) install(TARGETS rpn DESTINATION bin)
# packages # packages (common variables for all packages)
SET(CPACK_PACKAGE_FILE_NAME "${RPN_DISPLAY_NAME}-${RPN_VERSION}-amd64")
SET(CPACK_PACKAGE_NAME ${RPN_DISPLAY_NAME}) SET(CPACK_PACKAGE_NAME ${RPN_DISPLAY_NAME})
SET(CPACK_PACKAGE_FILE_NAME "${RPN_DISPLAY_NAME}-${RPN_VERSION}-amd64")
SET(CPACK_PACKAGE_VERSION ${RPN_VERSION}) SET(CPACK_PACKAGE_VERSION ${RPN_VERSION})
set(CPACK_PACKAGE_RELEASE 0)
SET(CPACK_PACKAGE_CONTACT ${RPN_CONTACT}) SET(CPACK_PACKAGE_CONTACT ${RPN_CONTACT})
set(CPACK_PACKAGE_VENDOR ${RPN_CONTACT})
set(CPACK_PACKAGE_LICENSE ${RPN_LICENSE})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY, ${RPN_FRIENDLY_STRING}) SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY, ${RPN_FRIENDLY_STRING})
SET(CPACK_PACKAGE_DESCRIPTION, ${RPN_FRIENDLY_STRING})
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_DESCRIPTION_FILE ${RPN_DESCRIPTION_FILE})
# DEB package # DEB package
SET(CPACK_GENERATOR "DEB") SET(CPACK_GENERATOR "DEB;RPM;TGZ")
SET(CPACK_DEBIAN_PACKAGE_NAME ${RPN_DISPLAY_NAME}) SET(CPACK_DEBIAN_PACKAGE_NAME ${RPN_DISPLAY_NAME})
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION, ${RPN_FRIENDLY_STRING}) SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION, ${RPN_FRIENDLY_STRING})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${RPN_CONTACT}) SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${RPN_CONTACT})
@ -62,3 +71,5 @@ SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${SYSTEM_PROCESSOR})
SET(CPACK_DEBIAN_PACKAGE_SECTION "math") SET(CPACK_DEBIAN_PACKAGE_SECTION "math")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
include(CPack) include(CPack)
# RPM package

View file

@ -59,8 +59,6 @@ rpn v2.2 is statically linked against
CMake must be installed on the generation machine CMake must be installed on the generation machine
To build RPM package you should install CMake 2.6.0 or higher
``` ```
# cd rpn/ # cd rpn/
# mkdir build # mkdir build
@ -74,19 +72,20 @@ rpn v2.2 is statically linked against
``` ```
- packages - packages
- DEB
To build RPM package you should install CMake 2.6.0 or higher
``` ```
# cd rpn/build # cd rpn/build
# make package # make package
``` [100%] Built target rpn
- RPM Run CPack packaging tool...
rpmbuild must be installed CPack: Create package using DEB
``` (...)
# cd rpn/build CPack: Create package using RPM
# cpack -G RPM (...)
``` CPack: Create package using TGZ
- TGZ (...)
``` # ls rpn*
# cd rpn/build rpn rpn-2.1-amd64.deb rpn-2.1-amd64.rpm rpn-2.1-amd64.tar.gz
# cpack -G TGZ ```
```

View file

@ -45,8 +45,9 @@ rpn>
### Objects ### Objects
Following objects are managed: **floating numbers**, **symbols**, **strings**, **programs**, plus language **keywords** (commands and flow controls) Following objects are managed: **floating numbers**, **complexes**, **symbols**, **strings**, **programs**, plus language **keywords** (commands and flow controls)
``` ```
5> (1,-2.33)
4> 'symbol' 4> 'symbol'
3> "string" 3> "string"
2> 12.3456 2> 12.3456