From fe3078df70d54e8ee1cc70869089908e72b1e136 Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Mon, 28 Sep 2020 21:40:46 +0100 Subject: [PATCH] Add coroutine/context boost shared libraries to the artifacts (#2984) * Add coroutine/context boost shared libraries to the artifacts * use regex to add boost shared libraries no need to add them individually unrelated dont include rocksdb artifacts in release bundle Co-authored-by: Russel --- CMakeLists.txt | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6291662c..fa7b41b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,7 @@ if (ENABLE_AVX2) else() set(PORTABLE ON CACHE BOOL "" FORCE) endif() -add_subdirectory(rocksdb) +add_subdirectory(rocksdb EXCLUDE_FROM_ALL) # There is a compile bug with boost 1.69 interprocess headers on Mac if (APPLE AND Boost_VERSION EQUAL 106900) @@ -561,18 +561,14 @@ if (NANO_GUI OR RAIBLOCKS_GUI) install (DIRECTORY ${Qt5_DIR}/../../QtWidgets.framework DESTINATION Nano.app/Contents/Frameworks) install (FILES "${Qt5_DIR}/../../../plugins/platforms/libqcocoa.dylib" DESTINATION Nano.app/Contents/PlugIns/platforms) if (NANO_SHARED_BOOST) - get_filename_component(Boost_LIB_DIR ${BOOST_ROOT}/lib ABSOLUTE) - install (FILES ${Boost_LIB_DIR}/libboost_log.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_filesystem.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_log_setup.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_regex.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_program_options.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_system.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_thread.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_date_time.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_chrono.dylib DESTINATION Nano.app/Contents/boost/lib) - install (FILES ${Boost_LIB_DIR}/libboost_atomic.dylib DESTINATION Nano.app/Contents/boost/lib) - endif() + foreach(boost_lib IN LISTS Boost_LIBRARIES) + string(REGEX MATCH "(.+/.*boost_[^-]+)" boost_lib_name ${boost_lib}) + set (boost_dll "${CMAKE_MATCH_1}") + if (${boost_dll} MATCHES "boost") + install (FILES ${boost_dll} DESTINATION Nano.app/Contents/boost/lib) + endif() + endforeach(boost_lib) + endif() if (NANO_POW_SERVER) install (TARGETS nano_pow_server DESTINATION Nano.app/Contents/MacOS) install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION Nano.app/Contents/MacOS) @@ -637,17 +633,13 @@ if (NANO_GUI OR RAIBLOCKS_GUI) RUNTIME DESTINATION ./bin ) if (NANO_SHARED_BOOST) - get_filename_component(Boost_LIB_DIR ${BOOST_ROOT}/lib ABSOLUTE) - install (FILES ${Boost_LIB_DIR}/libboost_log.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_filesystem.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_log_setup.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_regex.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_program_options.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_system.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_thread.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_date_time.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_chrono.so.${Boost_VERSION_STRING} DESTINATION ./lib) - install (FILES ${Boost_LIB_DIR}/libboost_atomic.so.${Boost_VERSION_STRING} DESTINATION ./lib) + foreach(boost_lib IN LISTS Boost_LIBRARIES) + string(REGEX MATCH "(.+/.*boost_[^-]+)" boost_lib_name ${boost_lib}) + set (boost_dll "${CMAKE_MATCH_1}.${Boost_VERSION_STRING}") + if (${boost_dll} MATCHES "boost") + install (FILES ${boost_dll} DESTINATION .) + endif() + endforeach(boost_lib) endif() if (NANO_POW_SERVER) install (TARGETS nano_pow_server DESTINATION ./bin)