source: sasview/build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/CMakeLists.txt @ 46ca1f4

Last change on this file since 46ca1f4 was c3b2327, checked in by trnielsen, 8 years ago

Added build scripts for Debian and RPM packages

  • Property mode set to 100644
File size: 1.9 KB
Line 
1cmake_minimum_required(VERSION 2.6)
2
3# This will install a pyinstaller-generated sasview
4project(sasview C)
5
6# Define the version of sasview being packaged
7option(SAS_VERSION "Define SASView version to package" off)
8
9if (NOT ${SAS_VERSION})
10  message(FATAL_ERROR "SASView version unspecified!\n"
11    "Please use e.g. -DSAS_VERSION=4.1 ")
12endif()
13
14# main install work is done in this function
15macro(installDir path)
16  # Main install location is defined via CMAKE_INSTALL_PREFIX
17  # - what is chosen here is a subdirectory
18  install (
19    DIRECTORY "${path}/"
20    DESTINATION "sasview/${SAS_VERSION}"
21    PATTERN "Makefile*" EXCLUDE  # skip makefiles
22    PATTERN "#*"        EXCLUDE  # skip backup files
23    PATTERN ".*"        EXCLUDE  # skip hidden files
24    PATTERN "*.out"     EXCLUDE  # skip binary files
25    PATTERN "*.*.in"    EXCLUDE  # skip configure processed template files
26    PATTERN "*"
27    PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
28    GROUP_EXECUTE GROUP_READ
29    WORLD_EXECUTE WORLD_READ
30  )
31endmacro()
32
33# CPack configuration
34set(CPACK_PACKAGE_NAME          "sasview-${SAS_VERSION}")
35set(CPACK_RESOURCE_FilE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}../../LICENSE.TXT")
36set(CPACK_PACKAGE_CONTACT       "pkwi@fysik.dtu.dk")
37
38set(CPACK_PACKAGE_VERSION       "1.0")
39set(CPACK_PACKAGE_VERSION_MAJOR "1")
40set(CPACK_PACKAGE_VERSION_MINOR "0")
41
42# Have CPack respect install prefix
43set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
44set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
45
46# Avoid e.g. /usr/local being "part" of the RPMs
47set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
48  ${CMAKE_INSTALL_PREFIX}
49  ${CMAKE_INSTALL_PREFIX}/bin
50  ${CMAKE_INSTALL_PREFIX}/sasview
51  )
52
53installDir("${PROJECT_SOURCE_DIR}/sasview")
54
55execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/sasview/${SAS_VERSION}/sasview sasview)
56install(FILES ${CMAKE_BINARY_DIR}/sasview DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/)
57
58include(CPack)
Note: See TracBrowser for help on using the repository browser.