X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=CMakeLists.txt;h=ae986c9baf6b77ff670c86b82e9e5321f18c6bce;hb=116d0f5b6c5b1a396fed835c714a5d568c264cc5;hp=ef8308b4d968a680f97fd29fad038f1f3049c3d3;hpb=02e8d49f42d94b51494977aa0d6f67479f1ceb1c;p=ric-plt%2Flib%2Frmr.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ef8308b..ae986c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,11 +33,13 @@ # -DSKIP_EXTERNALS=1 Do not use NNG submodule when building; uee installed packages # -DMAN_PREFIX= Supply a path where man pages are installed (default: /usr/share/man) +# See ci/build_all for an example of how to build and test + project( rmr LANGUAGES C ) cmake_minimum_required( VERSION 3.5 ) set( major_version "3" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this -set( minor_version "0" ) +set( minor_version "6" ) set( patch_level "2" ) set( install_root "${CMAKE_INSTALL_PREFIX}" ) @@ -274,15 +276,15 @@ set_target_properties( rmr_si_shared SOVERSION ${major_version} VERSION ${major_version}.${minor_version}.${patch_level} ) -# we only build/export the static archive (.a) if generating a dev package -if( DEV_PKG ) - add_library( rmr_si_static STATIC "$;$" ) - set_target_properties( rmr_si_static - PROPERTIES - OUTPUT_NAME "rmr_si" - SOVERSION ${major_version} - VERSION ${major_version}.${minor_version}.${patch_level} ) -endif() +# even if not generating a development package we still need to generate the .a so that health check +# can link against it to avoid RPM install issues. +# +add_library( rmr_si_static STATIC "$;$" ) +set_target_properties( rmr_si_static + PROPERTIES + OUTPUT_NAME "rmr_si" + SOVERSION ${major_version} + VERSION ${major_version}.${minor_version}.${patch_level} ) # if externals need to be built, then we must force them to be built first by depending on them if( need_ext ) @@ -293,6 +295,28 @@ if( need_ext ) endif() endif() +# ------------- testing ------------------------------------------------------- +enable_testing() +add_test( + NAME drive_unit_tests + COMMAND bash ../test/unit_test.ksh -q + WORKING_DIRECTORY ../test +) + +# cmake seems unable to start test/app_test/run_all.ksh, so we have to lump +# a dummy script in ./test that does the obvious thing. +add_test( + NAME drive_app + COMMAND bash ./run_app_tests LD_LIBRARY_PATH=${install_root}/lib C_INCLUDE_PATH=${install_root}/include + WORKING_DIRECTORY ../test +) + + +# --- support binaries that depend on the libs identified above --------------- +add_subdirectory( src/support ) + +# ------------- packaging ----------------------------------------------------- + # if( APPLE ) message( "### apple hack: forcing hard coded library paths for nng/nano dynamic libraries" ) @@ -341,6 +365,9 @@ IF( EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake" ) set( CPACK_DEBIAN_PACKAGE_NAME ${deb_pkg_name} ) set( CPACK_RPM_PACKAGE_NAME ${rpm_pkg_name} ) + # auto dependency checking makes the RPM install fail, see NOTES + set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION="/usr/local /usr/local/bin /usr/local/lib" ) + set( CPACK_set_DESTDIR "on" ) set( CPACK_PACKAGING_INSTALL_PREFIX "${install_root}" ) set( CPACK_GENERATOR "${pkg_list}" )