Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] introduce ECAL_CORE_HAS_PROTOBUF #1529

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ option(ECAL_USE_CLOCKLOCK_MUTEX "Use native mutex with monotonic
# --------------------------------------------------------
# ecal core configuration
# --------------------------------------------------------
set(ECAL_CORE_HAS_PROTOBUF ON)
set(ECAL_CORE_BUILD_SAMPLES ${BUILD_SAMPLES})
set(ECAL_CORE_BUILD_SAMPLES_PROTOBUF ${BUILD_SAMPLES})
set(ECAL_CORE_BUILD_TESTS ${BUILD_ECAL_TESTS})
set(ECAL_CORE_BUILD_TESTS_PROTOBUF ${BUILD_ECAL_TESTS})
set(ECAL_CORE_CONFIG_INIFILE ON)
set(ECAL_CORE_COMMAND_LINE ON)
set(ECAL_CORE_REGISTRATION ON)
Expand Down
2 changes: 1 addition & 1 deletion ecal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.13)
# --------------------------------------------------------
add_subdirectory(core)

if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(core_pb)
endif()

Expand Down
7 changes: 5 additions & 2 deletions ecal/ecal-core-options.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# ------------------------------------------------------------------------------------------------------------------------------------------------------------------
# available (optional) thirdparty dependencies
# ------------------------------------------------------------------------------------------------------------------------------------------------------------------
option(ECAL_CORE_HAS_PROTOBUF "Protobuf library is available, eCAL protobuf support will be enabled" ON)

# ------------------------------------------------------------------------------------------------------------------------------------------------------------------
# additional builds (adapt to your needs)
# ------------------------------------------------------------------------------------------------------------------------------------------------------------------
option(ECAL_CORE_BUILD_SAMPLES "Build the eCAL samples" ON)
option(ECAL_CORE_BUILD_SAMPLES_PROTOBUF "Build the eCAL samples using google protobuf message definition" ON)
option(ECAL_CORE_BUILD_TESTS "Build the eCAL google tests" ON)
option(ECAL_CORE_BUILD_TESTS_PROTOBUF "Build the eCAL google tests using google protobuf message definition" ON)

# ------------------------------------------------------------------------------------------------------------------------------------------------------------------
# core internal feature configuration (adapt to your needs)
Expand Down
12 changes: 6 additions & 6 deletions ecal/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ if(ECAL_CORE_MONITORING)
add_subdirectory(cpp/monitoring/monitoring_get_services)
add_subdirectory(cpp/monitoring/monitoring_get_topics)
add_subdirectory(cpp/monitoring/monitoring_performance)
if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/monitoring/monitoring_rec)
add_subdirectory(cpp/monitoring/monitoring_reg)
endif()
endif()

# orchestration
if(ECAL_CORE_PUBLISHER AND ECAL_CORE_SUBSCRIBER AND ECAL_CORE_SERVICE AND ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_PUBLISHER AND ECAL_CORE_SUBSCRIBER AND ECAL_CORE_SERVICE AND ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/orchestration/component1)
add_subdirectory(cpp/orchestration/component2)
add_subdirectory(cpp/orchestration/orchestrator)
Expand All @@ -99,7 +99,7 @@ if(ECAL_CORE_PUBLISHER)
add_subdirectory(cpp/pubsub/binary/binary_zero_copy_snd)
add_subdirectory(cpp/pubsub/binary/ping)
add_subdirectory(cpp/pubsub/string/minimal_snd)
if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/pubsub/protobuf/person_events_snd)
add_subdirectory(cpp/pubsub/protobuf/person_snd)
endif()
Expand All @@ -111,7 +111,7 @@ if(ECAL_CORE_SUBSCRIBER)
add_subdirectory(cpp/pubsub/binary/pong)
add_subdirectory(cpp/pubsub/string/minimal_rec)
add_subdirectory(cpp/pubsub/string/minimal_rec_cb)
if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/pubsub/protobuf/person_events_rec)
add_subdirectory(cpp/pubsub/protobuf/person_rec)
add_subdirectory(cpp/pubsub/protobuf/proto_dyn_json_rec)
Expand All @@ -123,7 +123,7 @@ if(ECAL_CORE_SUBSCRIBER)
endif()

if(ECAL_CORE_PUBLISHER AND ECAL_CORE_SUBSCRIBER)
if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/pubsub/protobuf/person_loopback)
endif()
endif()
Expand All @@ -134,7 +134,7 @@ if(ECAL_CORE_SERVICE)
add_subdirectory(cpp/services/latency_server)
add_subdirectory(cpp/services/minimal_client)
add_subdirectory(cpp/services/minimal_server)
if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/services/math_client)
add_subdirectory(cpp/services/math_server)
add_subdirectory(cpp/services/ping_client)
Expand Down
4 changes: 2 additions & 2 deletions ecal/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ if(ECAL_CORE_REGISTRATION AND ECAL_CORE_PUBLISHER AND ECAL_CORE_SUBSCRIBER)
if(ECAL_CORE_TRANSPORT_SHM OR ECAL_CORE_TRANSPORT_UDP) # this test is running for shm and udp layer only, needs to be fixed for tcp
add_subdirectory(cpp/pubsub_test)
endif()
if(ECAL_CORE_BUILD_TESTS_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/pubsub_proto_test)
endif()
endif()

if(ECAL_CORE_SERVICE)
add_subdirectory(cpp/clientserver_test)
if(ECAL_CORE_BUILD_TESTS_PROTOBUF)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/clientserver_proto_test)
endif()
endif()
Loading