-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
120 lines (105 loc) · 5.55 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
project(ndmanager-plugins)
cmake_minimum_required(VERSION 2.8.6)
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
add_subdirectory(scripts)
add_subdirectory(descriptions)
add_subdirectory(src)
add_subdirectory(python)
add_subdirectory(matlab)
# Set package information
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plugins for NDManager")
set(CPACK_PACKAGE_NAME "ndmanager-plugins" )
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "12")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ndmanager-plugins")
# Determine distribution and release
execute_process(COMMAND lsb_release -si OUTPUT_VARIABLE DISTRIBUTION OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND lsb_release -sc OUTPUT_VARIABLE RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND uname -i OUTPUT_VARIABLE ARCHITECTURE)
# Set package name and type (deb vs rpm)
if(DISTRIBUTION STREQUAL "Ubuntu")
# Set Ubuntu-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
if(ARCHITECTURE MATCHES ".*x86_64.*")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
else()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michaël Zugaro")
set(CPACK_DEBIAN_PACKAGE_SECTION "Science")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "klusters, neuroscope, ndmanager")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libasyncns0, libjson0, libtinfo5, libgsl0ldbl, python-qt4, libav-tools")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://ndmanager.sourceforge.net")
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/postrm;" )
# >>> TEMPLATE CODE FOR ADDITIONAL DEBIAN-LIKE DISTRIBUTIONS <<<
#elseif(DISTRIBUTION STREQUAL "Ubuntu")
#
# # Set Ubuntu-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
# if(ARCHITECTURE MATCHES ".*x86_64.*")
# set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
# else()
# set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
# endif()
# set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michaël Zugaro")
# set(CPACK_DEBIAN_PACKAGE_SECTION "Science")
# set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "klusters, neuroscope, ndmanager")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "")
# set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://ndmanager.sourceforge.net")
# set(CPACK_GENERATOR "DEB")
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/postrm;" )
# set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
elseif(DISTRIBUTION MATCHES "openSUSE.*")
# Set openSUSE-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
if(ARCHITECTURE MATCHES ".*x86_64.*")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
else()
set(CPACK_RPM_PACKAGE_ARCHITECTURE "i586")
endif()
set(CPACK_PACKAGE_CONTACT "Michaël Zugaro")
set(CPACK_RPM_PACKAGE_GROUP "Science")
set(CPACK_RPM_PACKAGE_LICENSE "GPL")
set(CPACK_RPM_PACKAGE_SUGGESTS "klusters, neuroscope, ndmanager")
set(CPACK_RPM_PACKAGE_REQUIRES "")
set(CPACK_RPM_PACKAGE_URL "http://ndmanager.sourceforge.net")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postrm")
elseif(DISTRIBUTION STREQUAL "Fedora")
# Set Fedora-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
execute_process(COMMAND lsb_release -sr OUTPUT_VARIABLE RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
if(ARCHITECTURE MATCHES ".*x86_64.*")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
else()
set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
endif()
set(CPACK_PACKAGE_CONTACT "Michaël Zugaro")
set(CPACK_RPM_PACKAGE_GROUP "Science")
set(CPACK_RPM_PACKAGE_LICENSE "GPL")
set(CPACK_RPM_PACKAGE_SUGGESTS "klusters, neuroscope, ndmanager")
set(CPACK_RPM_PACKAGE_REQUIRES "")
set(CPACK_RPM_PACKAGE_URL "http://ndmanager.sourceforge.net")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.fc${RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postrm")
# >>> TEMPLATE CODE FOR ADDITIONAL REDHAT-LIKE DISTRIBUTIONS <<<
#elseif(DISTRIBUTION MATCHES "openSUSE.*")
#
# # Set openSUSE-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
# set(CPACK_RPM_PACKAGE_ARCHITECTURE "noarch")
# set(CPACK_PACKAGE_CONTACT "Michaël Zugaro")
# set(CPACK_RPM_PACKAGE_GROUP "Science")
# set(CPACK_RPM_PACKAGE_LICENSE "GPL")
# set(CPACK_RPM_PACKAGE_SUGGESTS "klusters, neuroscope, ndmanager")
# set(CPACK_RPM_PACKAGE_REQUIRES "")
# set(CPACK_RPM_PACKAGE_URL "http://ndmanager.sourceforge.net")
# set(CPACK_GENERATOR "RPM")
# set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
# set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postrm")
# set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
endif()
include(CPack)