Skip to content

Commit

Permalink
Add an aggregate novatel_edie::novatel_edie target
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Sep 30, 2024
1 parent 3a782b5 commit 16459a5
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ add_subdirectory(src/stream_interface)
add_subdirectory(src/decoders/common)
add_subdirectory(src/decoders/oem)

# Add an aggregate target for all components
add_library(novatel_edie INTERFACE)
add_library(novatel_edie::novatel_edie ALIAS novatel_edie)
target_link_libraries(novatel_edie INTERFACE
common
stream_interface
decoders_common
oem_decoder
)

if(BUILD_TESTS)
enable_testing()
add_subdirectory(src/common/test)
Expand Down
2 changes: 1 addition & 1 deletion examples/novatel/command_encoding/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "command_encoding")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/converter_components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "converter_components")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/converter_file_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "converter_file_parser")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/converter_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "converter_parser")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/json_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "json_parser")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/range_decompressor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "range_decompressor")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/rangecmp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "range_decompressor")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
2 changes: 1 addition & 1 deletion examples/novatel/rxconfig_handler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(TARGET_NAME "rxconfig_handler")
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp)
target_link_libraries(${TARGET_NAME} novatel_edie::oem_decoder novatel_edie::stream_interface)
target_link_libraries(${TARGET_NAME} novatel_edie::novatel_edie)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "examples")
1 change: 0 additions & 1 deletion src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(TARGET_NAME "common")
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(novatel_edie::${TARGET_NAME} ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "edie_${TARGET_NAME}"
FOLDER "common"
Expand Down
2 changes: 1 addition & 1 deletion src/common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_executable(${TARGET_NAME} ${SOURCES})
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "common/tests")
find_package(GTest REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} PUBLIC novatel_edie::common GTest::gtest GTest::gtest_main)
target_link_libraries(${TARGET_NAME} PUBLIC common GTest::gtest GTest::gtest_main)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME} ${CMAKE_SOURCE_DIR})
3 changes: 1 addition & 2 deletions src/decoders/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(TARGET_NAME "decoders_common")
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(novatel_edie::${TARGET_NAME} ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "edie_${TARGET_NAME}"
FOLDER "decoders"
Expand All @@ -14,6 +13,6 @@ target_compile_features(${TARGET_NAME} PUBLIC cxx_std_17)

find_package(nlohmann_json REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} PUBLIC
novatel_edie::common
common
nlohmann_json::nlohmann_json
)
2 changes: 1 addition & 1 deletion src/decoders/common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_executable(${TARGET_NAME} ${SOURCES})
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "decoders/tests")
find_package(GTest REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} PUBLIC novatel_edie::decoders_common GTest::gtest GTest::gtest_main)
target_link_libraries(${TARGET_NAME} PUBLIC decoders_common GTest::gtest GTest::gtest_main)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME} ${CMAKE_SOURCE_DIR})
3 changes: 1 addition & 2 deletions src/decoders/oem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
set(TARGET_NAME "oem_decoder")
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(novatel_edie::${TARGET_NAME} ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "edie_${TARGET_NAME}"
FOLDER "decoders"
)
target_link_libraries(${TARGET_NAME} PUBLIC novatel_edie::common decoders_common stream_interface)
target_link_libraries(${TARGET_NAME} PUBLIC common decoders_common stream_interface)
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
Expand Down
2 changes: 1 addition & 1 deletion src/decoders/oem/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(${TARGET_NAME} ${SOURCES})
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "decoders/tests")
find_package(GTest REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} PUBLIC
novatel_edie::oem_decoder novatel_edie::stream_interface
oem_decoder stream_interface
GTest::gtest GTest::gtest_main
)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME} ${CMAKE_SOURCE_DIR})
3 changes: 1 addition & 2 deletions src/stream_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
set(TARGET_NAME "stream_interface")
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(novatel_edie::${TARGET_NAME} ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "edie_${TARGET_NAME}"
FOLDER "hw_interface"
)
target_link_libraries(${TARGET_NAME} PRIVATE novatel_edie::common)
target_link_libraries(${TARGET_NAME} PRIVATE common)
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
Expand Down
2 changes: 1 addition & 1 deletion src/stream_interface/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(${TARGET_NAME} ${SOURCES})
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "hw_interface/tests")
find_package(GTest REQUIRED CONFIG)
target_link_libraries(${TARGET_NAME} PUBLIC
novatel_edie::stream_interface
stream_interface
GTest::gtest GTest::gtest_main
)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME} ${CMAKE_SOURCE_DIR})

0 comments on commit 16459a5

Please sign in to comment.