Skip to content

Commit

Permalink
miniros::time is now separate static library
Browse files Browse the repository at this point in the history
  • Loading branch information
dkargin committed Aug 4, 2024
1 parent 93ed224 commit dff02b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 12 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions xmlrpcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit dff02b2

Please sign in to comment.