From a9435336c9df83676ae5b0e34a38a2f9b9dec589 Mon Sep 17 00:00:00 2001 From: "E. Scott Daniels" Date: Thu, 9 May 2019 14:39:19 +0000 Subject: [PATCH] fix(build): Capture lib dir info on all flavours For some flavours of Linux (arch, alpine, SuSE) the use of lib64 as the installation directory made it difficult to find the nano/nng libraries during the RMr build and install process. This change pulls the lib dir info as the nano/nng CMake files do and thus is able to find the libraries without needing a specific command line -D option on these systems. Change-Id: I70527865a47774ab446f6924788f5b864a776156 Signed-off-by: E. Scott Daniels --- CMakeLists.txt | 22 ++++++++++++---------- doc/CMakeLists.txt | 2 +- test/app_test/rebuild.ksh | 7 +++++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73d2ebd..21ea46a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,9 @@ project( rmr LANGUAGES C ) cmake_minimum_required( VERSION 3.5 ) - set( major_version "1" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this set( minor_version "0" ) -set( patch_level "20" ) +set( patch_level "21" ) set( install_root "${CMAKE_INSTALL_PREFIX}" ) set( install_lib "lib" ) @@ -39,8 +38,11 @@ endif() # locations on all platforms. include( GNUInstallDirs ) -if( NOT BUILD_LIB ) - set( BUILD_LIB lib ) +# nano/nng install using LIBDIR as established by the gnu include; it varies from system +# to system, and we don't trust that it is always set, so we default to lib. +# +if( NOT CMAKE_INSTALL_LIBDIR ) + set( CMAKE_INSTALL_LIBDIR "lib" ) endif() # ---------------- extract some things from git ------------------------------ @@ -249,12 +251,12 @@ install( TARGETS rmr_nng_shared;rmr_nng_static;rmr_shared;rmr_static EXPORT Libr if( need_ext ) message( "including nano and nng libraries in the deb" ) install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnanomsg${nano_so_suffix} - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnanomsg${nano_so_suffix_m} - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnanomsg${nano_so_suffix_mm} - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnng${nng_so_suffix} - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnng${nng_so_suffix_m} - ${CMAKE_CURRENT_BINARY_DIR}/${BUILD_LIB}/libnng${nng_so_suffix_mm} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnanomsg${nano_so_suffix} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnanomsg${nano_so_suffix_m} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnanomsg${nano_so_suffix_mm} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix_m} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnng${nng_so_suffix_mm} DESTINATION ${install_lib} ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 7a4c9b5..b4f4d8a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -119,6 +119,6 @@ if( BUILD_DOC ) add_custom_target( man_pages ALL DEPENDS ${man3_files};${man7_files} ) else() - message( "+++ not building doc, set -DBULID_DOC on cmake commandline to enable" ) + message( "+++ not building doc, set -DBULID_DOC=1 on cmake command line to enable" ) endif() unset( BUILD_DOC CACHE ) # prevent it from being applied next build unless specifically set on comd line diff --git a/test/app_test/rebuild.ksh b/test/app_test/rebuild.ksh index 04367ef..3e06c2c 100644 --- a/test/app_test/rebuild.ksh +++ b/test/app_test/rebuild.ksh @@ -30,6 +30,7 @@ build_path=../../.build +echo "$(date) build starts" >&2 ( set -e mkdir -p $build_path @@ -37,10 +38,12 @@ build_path=../../.build cd ${build_path##*/} cmake .. make package -) +) >/tmp/PID$$.log if (( $? != 0 )) then - echo "build failed" + cat /tmp/PID$$>log + echo "$(date) build failed" >&2 exit 1 fi +echo "$(date) build completed" >&2 -- 2.16.6