Skip to content

Commit

Permalink
fix(cmake): 修复examples component安装路径
Browse files Browse the repository at this point in the history
  • Loading branch information
minhanghuang committed Aug 9, 2023
1 parent 4d27589 commit 61879ec
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
1 change: 1 addition & 0 deletions cyber/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ target_link_libraries(cyber_example_service
)

add_subdirectory(common_component_example)
add_subdirectory(timer_component_example)
29 changes: 21 additions & 8 deletions cyber/examples/common_component_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
add_executable(channel_test_writer channel_test_writer.cc ../proto/examples.pb.cc)
add_executable(channel_test_writer
channel_test_writer.cc ../proto/examples.pb.cc
)

target_link_libraries(channel_test_writer
${TARGET_NAME}
${TARGET_NAME}
)

add_executable(channel_prediction_writer
channel_prediction_writer.cc ../proto/examples.pb.cc
)

add_executable(channel_prediction_writer channel_prediction_writer.cc ../proto/examples.pb.cc)
target_link_libraries(channel_prediction_writer
${TARGET_NAME}
${TARGET_NAME}
)

add_library(common_component_example SHARED
common_component_example.cc
../proto/examples.pb.cc
)

add_library(common_component_example SHARED common_component_example.cc ../proto/examples.pb.cc)
target_link_libraries(common_component_example
${TARGET_NAME}
)
set_target_properties(common_component_example PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")

set_target_properties(common_component_example PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/cyber/examples/common_component_example/"
)


file(COPY common.dag common.launch
DESTINATION ${CMAKE_BINARY_DIR}/share/examples/common_component_example
DESTINATION ${CMAKE_BINARY_DIR}/share/examples/common_component_example
)

install(FILES common.dag common.launch
DESTINATION share/examples/common_component_example
)

install(TARGETS common_component_example
LIBRARY DESTINATION lib
LIBRARY DESTINATION lib
)

26 changes: 26 additions & 0 deletions cyber/examples/timer_component_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

add_library(timer_component_example SHARED
timer_component_example.cc
../proto/examples.pb.cc
)

target_link_libraries(timer_component_example
${TARGET_NAME}
)

set_target_properties(timer_component_example PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/cyber/examples/timer_component_example/"
)

file(COPY timer.dag timer.launch
DESTINATION ${CMAKE_BINARY_DIR}/share/examples/timer_component_example
)

install(FILES timer.dag timer.launch
DESTINATION share/examples/timer_component_example
)

install(TARGETS timer_component_example
LIBRARY DESTINATION lib
)

0 comments on commit 61879ec

Please sign in to comment.