fix(build): Capture lib dir info on all flavours 31/131/1
authorE. Scott Daniels <daniels@research.att.com>
Thu, 9 May 2019 14:39:19 +0000 (14:39 +0000)
committerE. Scott Daniels <daniels@research.att.com>
Thu, 9 May 2019 14:39:19 +0000 (14:39 +0000)
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 <daniels@research.att.com>
CMakeLists.txt
doc/CMakeLists.txt
test/app_test/rebuild.ksh

index 73d2ebd..21ea46a 100644 (file)
 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}
        )
index 7a4c9b5..b4f4d8a 100644 (file)
@@ -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
index 04367ef..3e06c2c 100644 (file)
@@ -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