blob: 2cff53922adb267e12bd2b7bacd716bcfa597410 [file] [log] [blame]
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04001#
2#==================================================================================
E. Scott Daniels29d87162019-06-12 13:48:25 -04003# Copyright (c) 2019 Nokia
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04004# Copyright (c) 2018-2019 AT&T Intellectual Property.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#==================================================================================
18#
19
E. Scott Danielsf6f4f122019-06-18 16:02:17 -040020# This CMake definition supports several -D command line options:
21#
E. Scott Danielsec88d3c2019-11-13 09:40:22 -050022# -DDEBUG=n Enable debugging level n
E. Scott Danielsf6f4f122019-06-18 16:02:17 -040023# -DDEV_PKG=1 Development package configuration
24# -DBUILD_DOC=1 Man pages generated
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -040025# -DIGNORE_LIBDIR=1 Installation of rmr libries is into /usr/local/lib and ignores
26# value in CMAKE_INSTALL_LIBDIR.
27# system preferred (typically /usr/local/lib64).
E. Scott Danielsf6f4f122019-06-18 16:02:17 -040028# -DPRESERVE_PTYPE=1 Do not change the processor type when naming deb packages
29# -DPACK_EXTERNALS=1 Include external libraries used to build in the run-time package
E. Scott Danielse30fc3a2019-07-16 12:03:45 -040030# (This makes some stand-alone unit testing of bindings possible, it
31# is not meant to be used for production package generation.)
E. Scott Danielsec88d3c2019-11-13 09:40:22 -050032# -DGPROF=1 Enable profiling compile time flags
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -040033# -DSKIP_EXTERNALS=1 Do not use NNG submodule when building; uee installed packages
E. Scott Danielsf6f4f122019-06-18 16:02:17 -040034# -DMAN_PREFIX=<path> Supply a path where man pages are installed (default: /usr/share/man)
35
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040036project( rmr LANGUAGES C )
37cmake_minimum_required( VERSION 3.5 )
38
E. Scott Danielsec88d3c2019-11-13 09:40:22 -050039set( major_version "3" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
40set( minor_version "0" )
41set( patch_level "0" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040042
43set( install_root "${CMAKE_INSTALL_PREFIX}" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040044set( install_inc "include/rmr" )
45if( MAN_PREFIX )
46 set( install_man ${MAN_PREFIX} ) # is there a cmake var for this -- can't find one
47else()
48 set( install_man "/usr/share/man" ) # this needs to be fixed so it's not hard coded
49endif()
50
51# Must use GNUInstallDirs to install libraries into correct
52# locations on all platforms.
53include( GNUInstallDirs )
54
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -040055# nng installs using LIBDIR as established by the gnu include; it varies from system
56# to system, and we don't trust that it is always set, so we default to lib if it is missing.
E. Scott Danielsa9435332019-05-09 14:39:19 +000057#
58if( NOT CMAKE_INSTALL_LIBDIR )
59 set( CMAKE_INSTALL_LIBDIR "lib" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040060endif()
61
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -040062if( IGNORE_LIBDIR ) # if set, then force to lib otherwise use "system preference"
63 set( install_lib "lib" )
64else()
65 set( install_lib "${CMAKE_INSTALL_LIBDIR}" )
66endif()
67unset(IGNORE_LIBDIR CACHE ) # we don't want this to persist
68message( "+++ RMR library install target directory: ${install_lib}" )
69
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000070# ---------------- extract some things from git ------------------------------
71
72# commit id for the version string
E. Scott Daniels29d87162019-06-12 13:48:25 -040073execute_process(
74 COMMAND bash -c "git rev-parse --short HEAD|awk '{printf\"%s\", $0}'"
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040075 OUTPUT_VARIABLE git_id
76)
77
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000078# version information for library names and version string
E. Scott Daniels29d87162019-06-12 13:48:25 -040079execute_process(
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000080 COMMAND bash -c "git describe --tags --abbrev=0 HEAD 2>/dev/null | awk -v tag=0.0.4095 ' { tag=$1 } END{ print tag suffix }'|sed 's/\\./;/g' "
81 OUTPUT_VARIABLE mmp_version_str
82 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
83)
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -040084message( "+++ mmp version from tag: '${mmp_version_str}'" )
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000085
86# extra indicator to show that the build was based on modified file(s) and not the true commit
E. Scott Daniels29d87162019-06-12 13:48:25 -040087# (no hope of reproducing the exact library for debugging). Used only for the internal version
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000088# string.
E. Scott Daniels29d87162019-06-12 13:48:25 -040089execute_process(
90 COMMAND bash -c "git diff --shortstat|awk -v fmt=%s -v r=-rotten '{ s=r } END { printf( fmt, s ) }'"
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000091 OUTPUT_VARIABLE spoiled_str
92)
93
E. Scott Danielsd7109572019-04-18 14:01:16 +000094# uncomment these lines once CI starts adding a tag on merge
95#set( mmp_version ${mmp_version_str} )
96#list( GET mmp_version 0 major_version )
97#list( GET mmp_version 1 minor_version )
98#list( GET mmp_version 2 patch_level )
E. Scott Daniels68c5cf12019-04-12 15:14:40 +000099
E. Scott Danielsa1c1dc62019-09-30 13:05:12 -0400100if( DEBUG ) # if set, we'll set debugging on in the compile
101 set( debugging ${DEBUG} )
102 message( "+++ debugging is being set to ${DEBUG}" )
103else()
104 set( debugging 0 )
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500105 message( "+++ debugging is set to off" )
E. Scott Danielsa1c1dc62019-09-30 13:05:12 -0400106endif()
107unset( DEBUG CACHE ) # we don't want this to persist
E. Scott Daniels68c5cf12019-04-12 15:14:40 +0000108
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500109
E. Scott Danielsa1c1dc62019-09-30 13:05:12 -0400110# define constants used in the version string, debugging, etc.
E. Scott Daniels29d87162019-06-12 13:48:25 -0400111add_definitions(
112 -DGIT_ID=${git_id}
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400113 -DMAJOR_VER=${major_version}
114 -DMINOR_VER=${minor_version}
E. Scott Danielsd4f18ba2019-06-17 15:08:17 -0400115 -DPATCH_VER=${patch_level}
E. Scott Danielsa1c1dc62019-09-30 13:05:12 -0400116 -DDEBUG=${debugging}
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400117)
118
E. Scott Daniels29d87162019-06-12 13:48:25 -0400119# ---------------- suss out pkg gen tools so we don't fail generating packages that the system cannot support --------------
120
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400121# deb packages use underbars, and package manager(s) seem to flip the *_64 processor type
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400122# to the old (non-standard) amd64 string, so we do it here for consistency. Set -DPRESERVE_PTYPE=1
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400123# to prevent the flip. RPM packages will always be given the system generated processor type string.
124#
125if( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" )
126 if( NOT PRESERVE_PTYPE )
127 set( deb_sys_name "amd64" )
128 else()
129 set( deb_sys_name ${CMAKE_SYSTEM_PROCESSOR} )
130 endif()
131else()
132 set( deb_sys_name ${CMAKE_SYSTEM_PROCESSOR} )
133endif()
134unset( PRESERVE_PTYPE CACHE ) # we don't want this to persist
135
136set( rpm_sys_name ${CMAKE_SYSTEM_PROCESSOR} )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400137
138if( DEV_PKG )
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400139 set( deb_pkg_name "rmr-dev" )
140 set( rpm_pkg_name "rmr-devel" )
E. Scott Danielsd4f18ba2019-06-17 15:08:17 -0400141else()
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400142 set( deb_pkg_name "rmr" )
143 set( rpm_pkg_name "rmr" )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400144endif()
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400145
146set( pkg_label "rmr${spoiled_str}-${major_version}.${minor_version}.${patch_level}-${sys_name}" )
147set( rpm_pkg_label "${rpm_pkg_name}${spoiled_str}-${major_version}.${minor_version}.${patch_level}-${rpm_sys_name}" )
148set( deb_pkg_label "${deb_pkg_name}${spoiled_str}_${major_version}.${minor_version}.${patch_level}_${deb_sys_name}" )
149message( "+++ pkg name: ${deb_pkg_label}.deb" )
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400150
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400151#set( out_yml /tmp/build_output.yml ) # we will record package names (we record only untainted names)
E. Scott Daniels29d87162019-06-12 13:48:25 -0400152find_program( rpm NAMES rpmbuild ) # rpm package gen requires this to be installed
153
154set( gen_rpm 0 )
155if( "${rpm}" MATCHES "rpm-NOTFOUND" ) # cannot build rpm
156 set( pkg_list "DEB" )
157 message( "### make package will generate only deb package; cannot find support to generate rpm packages" )
158else()
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400159 message( "+++ pkg name: ${rpm_pkg_label}.rpm" ) # debugging if we think we can gen rpm too
E. Scott Daniels29d87162019-06-12 13:48:25 -0400160 set( pkg_list "DEB;RPM" )
161 set( gen_rpm 1 )
162 message( "+++ make package will generate both deb and rpm packages" )
163endif()
164
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400165# ---------------- setup nano/nng things ---------------------------------------
166if( NOT SKIP_EXTERNALS )
167 set( need_ext 1 ) # we force dependences on these for right build order
168 execute_process( COMMAND git submodule update --init -- ext/nng
169 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
170 )
171
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400172 if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ext/nng/CMakeLists.txt )
173 message( FATAL_ERROR "cannot find nng in our git source as a submodule: Giving up" ) # this will abort which seems wrong, but tdam.
174 endif()
175
176 include( ExternalProject )
177 ExternalProject_Add(
178 ext_nng
179 SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ext/nng"
180 CMAKE_ARGS "-DBUILD_SHARED_LIBS=1"
181 CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}"
182 BUILD_COMMAND "make"
183 UPDATE_COMMAND ""
184 TEST_COMMAND ""
185 STEP_TARGETS build
186 )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400187
188 # it seems impossible to install everything that lands in {bin}/lib, so we need to
189 # hard code (shudder) some things. Even worse, we have to make exceptions for
190 # builds on apple (osx) since their naming convention wandered off the path.
191 set( nng_major 1 )
192 set( nng_minor 1.0 )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400193 set( so ${CMAKE_SHARED_LIBRARY_SUFFIX} ) # cmake variables are impossibly long :(
194 if( NOT APPLE ) # probably breaks in windows, but idc
195 set( nng_so_suffix ${so} )
196 set( nng_so_suffix_m ${so}.${nng_major} )
197 set( nng_so_suffix_mm ${so}.${nng_major}.${nng_minor} )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400198 else()
199 # of course apple puts versions before the suffix :(
200 set( nng_so_suffix ${so} ) # so has a lead dot, so NOT needed
201 set( nng_so_suffix_m ".${nng_major}${so}" ) # these need leading dots
202 set( nng_so_suffix_mm ".${nng_major}.${nng_minor}${so}" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400203 endif()
204
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400205 message( "+++ building with nng: ${nng_major}.${nng_minor}" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400206else()
E. Scott Daniels29d87162019-06-12 13:48:25 -0400207 if( PACK_EXTERNALS )
E. Scott Danielse30fc3a2019-07-16 12:03:45 -0400208 # This makes some stand-alone unit testing possible for bindings and transport layer testing;
209 # it is not meant for production packages.
210 #
E. Scott Daniels29d87162019-06-12 13:48:25 -0400211 unset( SKIP_EXTERNALS CACHE ) # must remove so as not to trap user into a never ending failure
212 unset( PACK_EXTERNALS CACHE )
213 message( FATAL_ERROR "ERROR: PACK_EXTERNALS can be set only if SKIP_EXTERNALS is unset (=0, or not supplied on command line)" )
214 endif()
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400215 set( need_ext 0 )
216endif()
E. Scott Daniels29d87162019-06-12 13:48:25 -0400217
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400218
219
220# this gets us round a chicken/egg problem. include files don't exist until make is run
221# but Cmake insists on having these exist when we add them to include directories to
222# enable rmr code to find them after we build them.
223#
224execute_process( COMMAND "mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/nng" )
225include_directories( "${CMAKE_CURRENT_BINARY_DIR}/include" )
226
227
228# Compiler flags
229#
230set( CMAKE_POSITION_INDEPENDENT_CODE ON )
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500231#set( CMAKE_C_FLAGS "-g -Wall " )
232#set( CMAKE_C_FLAGS "-g " )
233if( GPROF ) # if set, we'll set profiling flag on compiles
234 message( "+++ profiling is on" )
235 set( CMAKE_C_FLAGS "-pg " )
236else()
237 message( "+++ profiling is off" )
238 set( CMAKE_C_FLAGS "-g " )
239endif()
240unset( GPROF CACHE ) # we don't want this to persist
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400241
242# Include modules
E. Scott Daniels68c1ab22019-05-17 17:50:59 +0000243add_subdirectory( src/rmr/common )
E. Scott Daniels68c1ab22019-05-17 17:50:59 +0000244add_subdirectory( src/rmr/nng )
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500245add_subdirectory( src/rmr/si )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400246add_subdirectory( doc ) # this will auto skip if {X}fm is not available
247
248
E. Scott Daniels29d87162019-06-12 13:48:25 -0400249# shared and static libraries are built from the same object files.
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400250# librmr_nng is a combination of common and nng specific rmr functions.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400251#
E. Scott Daniels68c5cf12019-04-12 15:14:40 +0000252
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400253add_library( rmr_nng_shared SHARED "$<TARGET_OBJECTS:nng_objects>;$<TARGET_OBJECTS:common_objects>" )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400254set_target_properties( rmr_nng_shared
255 PROPERTIES
256 OUTPUT_NAME "rmr_nng"
257 SOVERSION ${major_version}
258 VERSION ${major_version}.${minor_version}.${patch_level} )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400259
E. Scott Daniels29d87162019-06-12 13:48:25 -0400260# we only build/export the static archive (.a) if generating a dev package
261if( DEV_PKG )
262 add_library( rmr_nng_static STATIC "$<TARGET_OBJECTS:nng_objects>;$<TARGET_OBJECTS:common_objects>" )
263 set_target_properties( rmr_nng_static
264 PROPERTIES
265 OUTPUT_NAME "rmr_nng"
266 SOVERSION ${major_version}
267 VERSION ${major_version}.${minor_version}.${patch_level} )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400268endif()
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400269
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500270add_library( rmr_si_shared SHARED "$<TARGET_OBJECTS:rmr_si_objects>;$<TARGET_OBJECTS:common_objects>" )
271set_target_properties( rmr_si_shared
272 PROPERTIES
273 OUTPUT_NAME "rmr_si"
274 SOVERSION ${major_version}
275 VERSION ${major_version}.${minor_version}.${patch_level} )
276
277# we only build/export the static archive (.a) if generating a dev package
278if( DEV_PKG )
279 add_library( rmr_si_static STATIC "$<TARGET_OBJECTS:rmr_si_objects>;$<TARGET_OBJECTS:common_objects>" )
280 set_target_properties( rmr_si_static
281 PROPERTIES
282 OUTPUT_NAME "rmr_si"
283 SOVERSION ${major_version}
284 VERSION ${major_version}.${minor_version}.${patch_level} )
285endif()
286
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400287# if externals need to be built, then we must force them to be built first by depending on them
288if( need_ext )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400289 if( DEV_PKG )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400290 add_dependencies( rmr_nng_shared;rmr_nng_static ext_nng )
291 else()
E. Scott Daniels29d87162019-06-12 13:48:25 -0400292 add_dependencies( rmr_nng_shared ext_nng )
293 endif()
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400294endif()
295
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400296#
297if( APPLE )
298 message( "### apple hack: forcing hard coded library paths for nng/nano dynamic libraries" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400299 target_link_libraries( rmr_nng_shared ${CMAKE_CURRENT_BINARY_DIR}/lib/libnng${nng_so_suffix} )
300endif()
301
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400302# Define what should be installed, and where they should go. For dev package we install
303# only the RMr headers, man pages and archive (.a) files. The run-time package gets just
304# the library (.so) files and nothing more.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400305#
E. Scott Daniels29d87162019-06-12 13:48:25 -0400306if( DEV_PKG )
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500307 set( target_list "rmr_nng_static;rmr_si_static" )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400308else()
E. Scott Danielsec88d3c2019-11-13 09:40:22 -0500309 set( target_list "rmr_nng_shared;rmr_si_shared" )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400310endif()
311
312install( TARGETS ${target_list} EXPORT LibraryConfig
313 LIBRARY DESTINATION ${install_lib}
314 ARCHIVE DESTINATION ${install_lib}
315 PUBLIC_HEADER DESTINATION ${install_inc}
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400316)
317
318
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400319unset( DEV_PKG CACHE ) # prevent from being a hidden setting if user redoes things
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400320
E. Scott Daniels29d87162019-06-12 13:48:25 -0400321# install any nano/nng libraries in to the deb as well, but ONLY if asked for on the 'cmake ..' command
322# (sure would be nice if FILEs allowed for globbing; sadlyy it does not.)
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400323#
E. Scott Daniels29d87162019-06-12 13:48:25 -0400324if( PACK_EXTERNALS )
E. Scott Daniels257323c2019-06-14 12:30:21 -0400325 message( "+++ including nano and nng libraries in the deb" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400326 install( FILES
E. Scott Danielsa9435332019-05-09 14:39:19 +0000327 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix}
328 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix_m}
329 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix_mm}
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400330
331 DESTINATION ${install_lib}
332 )
333endif()
334
E. Scott Daniels257323c2019-06-14 12:30:21 -0400335unset( SKIP_EXTERNALS CACHE ) # prevent these from being applied next build unless specifically set on comd line
336unset( PACK_EXTERNALS CACHE )
337
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400338IF( EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake" )
339 include( InstallRequiredSystemLibraries )
340
E. Scott Daniels78da4c92019-06-19 10:59:18 -0400341 set( CPACK_DEBIAN_PACKAGE_NAME ${deb_pkg_name} )
342 set( CPACK_RPM_PACKAGE_NAME ${rpm_pkg_name} )
343
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400344 set( CPACK_set_DESTDIR "on" )
345 set( CPACK_PACKAGING_INSTALL_PREFIX "${install_root}" )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400346 set( CPACK_GENERATOR "${pkg_list}" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400347
348 set( CPACK_PACKAGE_DESCRIPTION "Thin library for RIC xAPP messaging routed based on message type." )
349 set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "RIC message routing library" )
350 set( CPACK_PACKAGE_VENDOR "None" )
351 set( CPACK_PACKAGE_CONTACT "None" )
352 set( CPACK_PACKAGE_VERSION_MAJOR "${major_version}" )
353 set( CPACK_PACKAGE_VERSION_MINOR "${minor_version}" )
354 set( CPACK_PACKAGE_VERSION_PATCH "${patch_level}" )
E. Scott Danielsf6f4f122019-06-18 16:02:17 -0400355 set( CPACK_PACKAGE "${pkg_label}" ) # generic name for old versions of cpack
E. Scott Danielsd4f18ba2019-06-17 15:08:17 -0400356 set( CPACK_DEBIAN_FILE_NAME "${deb_pkg_label}.deb" )
357 set( CPACK_RPM_FILE_NAME "${rpm_pkg_label}.rpm" )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400358
E. Scott Danielsb0ba22e2019-08-06 13:26:12 -0400359 # there is not an NNG package, so we cannot define a dependency
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400360
361 set( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
362 set( CPACK_DEBIAN_PACKAGE_SECTION "ric" )
363 set( CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR} )
E. Scott Daniels29d87162019-06-12 13:48:25 -0400364 set( CPACK_RPM_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR} )
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400365
366 # this seems ingnored if included
367 #set( CPACK_COMPONENTS_ALL Libraries ApplicationData )
368
369 INCLUDE( CPack )
370ENDIF()