From b6d145aa352ea3d44375ff4ceae9e427799a7f4f Mon Sep 17 00:00:00 2001 From: postal Date: Fri, 6 Feb 2015 19:24:43 +0100 Subject: [PATCH 1/4] Dependencies update for linux/cmake --- libuavcan_drivers/linux/CMakeLists.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/libuavcan_drivers/linux/CMakeLists.txt b/libuavcan_drivers/linux/CMakeLists.txt index 6069f762d0..252cd8a69e 100644 --- a/libuavcan_drivers/linux/CMakeLists.txt +++ b/libuavcan_drivers/linux/CMakeLists.txt @@ -11,6 +11,12 @@ project(libuavcan_linux) # install(DIRECTORY include/uavcan_linux DESTINATION include) +# +# System dependecies +# +find_package(Threads REQUIRED) + + # # Finding libuavcan - it will be a target if we're running from the top-level CMakeLists.txt, # otherwise try to find it in the system directories. @@ -36,27 +42,27 @@ set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -std=c++0x") # GCC or Clang # These aren't installed, an average library user should not care about them. # add_executable(test_clock apps/test_clock.cpp) -target_link_libraries(test_clock ${UAVCAN_LIB} rt) +target_link_libraries(test_clock ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) add_executable(test_socket apps/test_socket.cpp) -target_link_libraries(test_socket ${UAVCAN_LIB} rt) +target_link_libraries(test_socket ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) add_executable(test_node apps/test_node.cpp) -target_link_libraries(test_node ${UAVCAN_LIB} rt) +target_link_libraries(test_node ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) add_executable(test_time_sync apps/test_time_sync.cpp) -target_link_libraries(test_time_sync ${UAVCAN_LIB} rt) +target_link_libraries(test_time_sync ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) # # Tools # Someday they will be replaced with Python scripts (pyuavcan is not finished at the moment) # add_executable(uavcan_status_monitor apps/uavcan_status_monitor.cpp) -target_link_libraries(uavcan_status_monitor ${UAVCAN_LIB} rt) +target_link_libraries(uavcan_status_monitor ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) add_executable(uavcan_nodetool apps/uavcan_nodetool.cpp) -target_link_libraries(uavcan_nodetool ${UAVCAN_LIB} rt) +target_link_libraries(uavcan_nodetool ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS uavcan_status_monitor uavcan_nodetool - RUNTIME DESTINATION bin) + RUNTIME DESTINATION bin) \ No newline at end of file From 1bf41b135dedc24c5dd38549e69356433a5da22a Mon Sep 17 00:00:00 2001 From: postal Date: Fri, 6 Feb 2015 19:42:26 +0100 Subject: [PATCH 2/4] Dependencies update for linux/cmake --- libuavcan_drivers/linux/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libuavcan_drivers/linux/CMakeLists.txt b/libuavcan_drivers/linux/CMakeLists.txt index 252cd8a69e..803c4daae3 100644 --- a/libuavcan_drivers/linux/CMakeLists.txt +++ b/libuavcan_drivers/linux/CMakeLists.txt @@ -26,7 +26,7 @@ if (TARGET uavcan) set(UAVCAN_LIB uavcan) include_directories(${libuavcan_SOURCE_DIR}/include ${libuavcan_SOURCE_DIR}/include/dsdlc_generated) -else () +else ()- message(STATUS "Using installed uavcan library") find_library(UAVCAN_LIB uavcan REQUIRED) endif () @@ -65,4 +65,5 @@ target_link_libraries(uavcan_nodetool ${UAVCAN_LIB} rt ${CMAKE_THREAD_LIBS_INIT} install(TARGETS uavcan_status_monitor uavcan_nodetool - RUNTIME DESTINATION bin) \ No newline at end of file + RUNTIME DESTINATION bin) + \ No newline at end of file From 41755b46a81aa212a849e3e4ec52a79e6ce92be9 Mon Sep 17 00:00:00 2001 From: postal Date: Fri, 6 Feb 2015 19:50:02 +0100 Subject: [PATCH 3/4] Dependencies update for linux/cmake --- libuavcan_drivers/linux/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libuavcan_drivers/linux/CMakeLists.txt b/libuavcan_drivers/linux/CMakeLists.txt index 803c4daae3..99e75959b0 100644 --- a/libuavcan_drivers/linux/CMakeLists.txt +++ b/libuavcan_drivers/linux/CMakeLists.txt @@ -26,7 +26,7 @@ if (TARGET uavcan) set(UAVCAN_LIB uavcan) include_directories(${libuavcan_SOURCE_DIR}/include ${libuavcan_SOURCE_DIR}/include/dsdlc_generated) -else ()- +else () message(STATUS "Using installed uavcan library") find_library(UAVCAN_LIB uavcan REQUIRED) endif () From 672874d11e0474ce64e842a9d307cc15bd8dc987 Mon Sep 17 00:00:00 2001 From: postal Date: Fri, 6 Feb 2015 19:54:18 +0100 Subject: [PATCH 4/4] Dependencies update for linux/cmake --- libuavcan_drivers/linux/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/libuavcan_drivers/linux/CMakeLists.txt b/libuavcan_drivers/linux/CMakeLists.txt index 99e75959b0..51cbcf1c97 100644 --- a/libuavcan_drivers/linux/CMakeLists.txt +++ b/libuavcan_drivers/linux/CMakeLists.txt @@ -16,7 +16,6 @@ install(DIRECTORY include/uavcan_linux DESTINATION include) # find_package(Threads REQUIRED) - # # Finding libuavcan - it will be a target if we're running from the top-level CMakeLists.txt, # otherwise try to find it in the system directories.