From dff02b20641034b03e16e862c38a44c171c51c2f Mon Sep 17 00:00:00 2001 From: Dmitry Kargin Date: Sun, 4 Aug 2024 12:58:46 +0300 Subject: [PATCH] miniros::time is now separate static library --- src/CMakeLists.txt | 16 ++++++++++++---- xmlrpcpp/CMakeLists.txt | 6 ++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 54e1971..b3a340f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,15 +173,23 @@ if (MINIROS_USE_SYSTEM_PROGRAM_OPTIONS) add_library(impl::program_options ALIAS Boost::program_options) endif () +find_package(Threads REQUIRED) + +add_library(miniros_time STATIC ${rostime_SRC}) +target_include_directories(miniros_time PUBLIC ${MINIROS_INCLUDE_DIRS}) +set_property(TARGET miniros_time PROPERTY POSITION_INDEPENDENT_CODE ON) +add_library(miniros::time ALIAS miniros_time) + + if (MINIROS_BUILD_SHARED_LIBS) - add_library(roscxx SHARED ${rostime_SRC} ${cpp_common_SRC} ${transport_SRC}) + add_library(roscxx SHARED ${cpp_common_SRC} ${transport_SRC}) else() - add_library(roscxx ${rostime_SRC} ${cpp_common_SRC} ${transport_SRC}) + add_library(roscxx ${cpp_common_SRC} ${transport_SRC}) endif() set_property(TARGET roscxx PROPERTY CXX_STANDARD 17) -target_link_libraries(roscxx PRIVATE xmlrpcpp rt stdc++fs ${console_bridge_LIBRARIES}) +target_link_libraries(roscxx PRIVATE xmlrpcpp rt stdc++fs miniros::time ${console_bridge_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) target_compile_definitions(roscxx PRIVATE rostime_EXPORTS miniros_EXPORTS) @@ -218,7 +226,7 @@ target_include_directories(bag_storage PRIVATE ${MINIROS_INCLUDE_DIRS} ${rosbag_ target_compile_definitions(bag_storage PRIVATE rosbag_EXPORTS rosbag_storage_EXPORTS roslz4_EXPORTS) set_property(TARGET bag_storage PROPERTY CXX_STANDARD 17) -target_link_libraries(bag_storage ${ENCRYPT_LIBRARIES} ${rosbag_LIBS} roscxx) +target_link_libraries(bag_storage ${ENCRYPT_LIBRARIES} ${rosbag_LIBS} miniros_time roscxx) if (MINIROS_BUILD_ROSBAG_APPS) diff --git a/xmlrpcpp/CMakeLists.txt b/xmlrpcpp/CMakeLists.txt index bc3cf33..6538dc4 100644 --- a/xmlrpcpp/CMakeLists.txt +++ b/xmlrpcpp/CMakeLists.txt @@ -6,11 +6,8 @@ include_directories( # This thing can ocasionly override local paths #${MINIROS_INCLUDE_ROOT} libb64/include -# ${catkin_INCLUDE_DIRS} ) -#link_directories(${catkin_LIBRARY_DIRS}) - if(WIN32) add_definitions(-D_WINDOWS) endif() @@ -34,7 +31,8 @@ set_target_properties(xmlrpcpp PROPERTIES POSITION_INDEPENDENT_CODE ON) # Allows access to generated header miniros/config.h target_include_directories(xmlrpcpp PRIVATE AFTER ${MINIROS_INCLUDE_DIRS} ${MINIROS_INCLUDE_ROOT}) -#target_link_libraries(xmlrpcpp ${catkin_LIBRARIES}) +target_link_libraries(xmlrpcpp miniros::time) + if(WIN32) target_link_libraries(xmlrpcpp ws2_32) endif()