From ce3d715d7b652f7f44f68c499387230fdc6c2d18 Mon Sep 17 00:00:00 2001 From: DownerCase <119755054+DownerCase@users.noreply.github.com> Date: Mon, 27 Jan 2025 08:13:12 +0000 Subject: [PATCH 1/2] [cmake] Make C bindings optional (#1947) --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c871e9147b..65916db3f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,8 @@ option(BUILD_APPS "Build the eCAL applications" option(BUILD_APP_REC_ADDON_SDK "Build eCAL rec addon SDK" ${BUILD_APPS}) option(BUILD_SAMPLES "Build the eCAL samples" ON) option(BUILD_TIME "Build the eCAL time interfaces" ON) +option(BUILD_C_BINDING "Build eCAL C binding" ON) +mark_as_advanced(FORCE BUILD_C_BINDING) option(BUILD_PY_BINDING "Build eCAL python binding" OFF) option(BUILD_CSHARP_BINDING "Build eCAL C# binding" OFF) option(BUILD_ECAL_TESTS "Build the eCAL google tests" OFF) @@ -331,9 +333,11 @@ if(BUILD_CSHARP_BINDING AND WIN32) add_subdirectory(lang/csharp) endif() -set(ECAL_C_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_C_BUILD_TESTS ${BUILD_ECAL_TESTS}) -add_subdirectory(lang/c) +if(BUILD_C_BINDING) + set(ECAL_C_BUILD_SAMPLES ${BUILD_SAMPLES}) + set(ECAL_C_BUILD_TESTS ${BUILD_ECAL_TESTS}) + add_subdirectory(lang/c) +endif() # -------------------------------------------------------- # console applications From 8c2f54dc801a4988621832820b9ce1c41c9e0007 Mon Sep 17 00:00:00 2001 From: DownerCase <119755054+DownerCase@users.noreply.github.com> Date: Mon, 27 Jan 2025 08:36:20 +0000 Subject: [PATCH 2/2] [cmake] Create explicit warnings target (#1948) * Add ecal warnings target; use keyword target_link_libraries --- .github/workflows/build-windows.yml | 1 + CMakeLists.txt | 1 + app/app_pb/CMakeLists.txt | 2 +- app/meas_cutter/CMakeLists.txt | 12 +++++---- app/mon/mon_cli/CMakeLists.txt | 2 +- app/mon/mon_gui/CMakeLists.txt | 4 +-- .../capnproto_reflection/CMakeLists.txt | 2 +- .../plugin_template/CMakeLists.txt | 2 +- .../protobuf_reflection/CMakeLists.txt | 2 +- .../raw_data_reflection/CMakeLists.txt | 2 +- .../signals_plotting/CMakeLists.txt | 2 +- .../string_reflection/CMakeLists.txt | 2 +- app/mon/mon_tui/CMakeLists.txt | 2 +- app/play/play_cli/CMakeLists.txt | 2 +- app/play/play_gui/CMakeLists.txt | 2 +- app/rec/rec_gui/CMakeLists.txt | 4 +-- app/rec/rec_server_cli/CMakeLists.txt | 2 +- app/sys/sys_cli/CMakeLists.txt | 2 +- app/sys/sys_client_cli/CMakeLists.txt | 2 +- app/sys/sys_gui/CMakeLists.txt | 2 +- app/util/config/CMakeLists.txt | 2 +- app/util/launcher/CMakeLists.txt | 2 +- app/util/stop/CMakeLists.txt | 2 +- .../helper_functions/ecal_add_functions.cmake | 16 +++++++++-- .../ecal_compiler_warnings.cmake | 27 +++++++++++++++++++ contrib/ecaltime/ecaltime_pb/CMakeLists.txt | 2 +- contrib/ecaltime/linuxptp/CMakeLists.txt | 2 +- contrib/ecaltime/localtime/CMakeLists.txt | 2 +- contrib/mma/CMakeLists.txt | 2 +- ecal/core_pb/CMakeLists.txt | 2 +- .../cpp/benchmarks/counter_rec/CMakeLists.txt | 2 +- .../cpp/benchmarks/counter_snd/CMakeLists.txt | 2 +- .../benchmarks/datarate_rec/CMakeLists.txt | 2 +- .../benchmarks/datarate_snd/CMakeLists.txt | 2 +- .../cpp/benchmarks/dynsize_snd/CMakeLists.txt | 2 +- .../cpp/benchmarks/latency_rec/CMakeLists.txt | 2 +- .../cpp/benchmarks/latency_snd/CMakeLists.txt | 2 +- .../many_connections_rec/CMakeLists.txt | 2 +- .../many_connections_snd/CMakeLists.txt | 2 +- .../benchmarks/massive_pub_sub/CMakeLists.txt | 2 +- .../benchmarks/multiple_rec/CMakeLists.txt | 2 +- .../benchmarks/multiple_snd/CMakeLists.txt | 2 +- .../benchmarks/performance_rec/CMakeLists.txt | 2 +- .../benchmarks/performance_snd/CMakeLists.txt | 2 +- .../cpp/benchmarks/perftool/CMakeLists.txt | 2 +- .../pubsub_throughput/CMakeLists.txt | 2 +- ecal/samples/cpp/misc/config/CMakeLists.txt | 2 +- ecal/samples/cpp/misc/process/CMakeLists.txt | 2 +- ecal/samples/cpp/misc/time/CMakeLists.txt | 2 +- ecal/samples/cpp/misc/timer/CMakeLists.txt | 2 +- .../monitoring_get_services/CMakeLists.txt | 2 +- .../monitoring_get_topics/CMakeLists.txt | 2 +- .../monitoring_performance/CMakeLists.txt | 2 +- .../monitoring/monitoring_rec/CMakeLists.txt | 2 +- .../pubsub/binary/binary_rec/CMakeLists.txt | 2 +- .../pubsub/binary/binary_snd/CMakeLists.txt | 2 +- .../binary_zero_copy_rec/CMakeLists.txt | 2 +- .../binary_zero_copy_snd/CMakeLists.txt | 2 +- .../cpp/pubsub/binary/ping/CMakeLists.txt | 2 +- .../cpp/pubsub/binary/pong/CMakeLists.txt | 2 +- .../services/latency_client/CMakeLists.txt | 2 +- .../services/latency_server/CMakeLists.txt | 2 +- .../services/minimal_client/CMakeLists.txt | 2 +- .../services/minimal_server/CMakeLists.txt | 2 +- .../pubsub/string/minimal_rec/CMakeLists.txt | 2 +- .../string/minimal_rec_cb/CMakeLists.txt | 2 +- .../pubsub/string/minimal_snd/CMakeLists.txt | 2 +- .../services/minimal_client_c/CMakeLists.txt | 2 +- .../services/minimal_server_c/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 5 +++- .../cpp/measurement/benchmark/CMakeLists.txt | 2 +- .../samples/pubsub/minimal_rec/CMakeLists.txt | 2 +- .../pubsub/minimal_rec_cb/CMakeLists.txt | 2 +- .../samples/pubsub/minimal_snd/CMakeLists.txt | 2 +- 75 files changed, 125 insertions(+), 79 deletions(-) create mode 100644 cmake/helper_functions/ecal_compiler_warnings.cmake diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 6917f1d7bc..3a74d5a1f3 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -194,6 +194,7 @@ jobs: # -------------------------------------------------------------------------------------------------- sign-windows-installer: + if: github.repository == 'eclipse-ecal/ecal' runs-on: windows-2019 needs: build-windows diff --git a/CMakeLists.txt b/CMakeLists.txt index 65916db3f8..d5f37b8ad6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,6 +495,7 @@ install(FILES ${eCAL_config} ${eCAL_config_version} install(FILES cmake/helper_functions/ecal_add_functions.cmake + cmake/helper_functions/ecal_compiler_warnings.cmake cmake/helper_functions/ecal_helper_functions.cmake cmake/helper_functions/ecal_install_functions.cmake DESTINATION ${${PROJECT_NAME}_install_cmake_dir}/helper_functions diff --git a/app/app_pb/CMakeLists.txt b/app/app_pb/CMakeLists.txt index 4118e26256..0b2dc7e8e4 100644 --- a/app/app_pb/CMakeLists.txt +++ b/app/app_pb/CMakeLists.txt @@ -68,7 +68,7 @@ target_compile_options(${PROJECT_NAME} set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) +target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) ecal_install_library(${PROJECT_NAME}) diff --git a/app/meas_cutter/CMakeLists.txt b/app/meas_cutter/CMakeLists.txt index 2c41c73ab6..442c3087a5 100644 --- a/app/meas_cutter/CMakeLists.txt +++ b/app/meas_cutter/CMakeLists.txt @@ -52,11 +52,13 @@ ecal_add_app_console(${PROJECT_NAME} ${meas_cutter_src}) target_include_directories(${PROJECT_NAME} PRIVATE $) -target_link_libraries(${PROJECT_NAME} yaml-cpp::yaml-cpp - tclap::tclap - eCAL::ecal-utils - eCAL::hdf5 - Threads::Threads) +target_link_libraries(${PROJECT_NAME} PRIVATE + yaml-cpp::yaml-cpp + tclap::tclap + eCAL::ecal-utils + eCAL::hdf5 + Threads::Threads +) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/app/mon/mon_cli/CMakeLists.txt b/app/mon/mon_cli/CMakeLists.txt index a9a94faa2e..f4923bdf0e 100644 --- a/app/mon/mon_cli/CMakeLists.txt +++ b/app/mon/mon_cli/CMakeLists.txt @@ -41,7 +41,7 @@ target_compile_definitions(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE tclap::tclap eCAL::protobuf_core eCAL::string_core diff --git a/app/mon/mon_gui/CMakeLists.txt b/app/mon/mon_gui/CMakeLists.txt index dd6da21bda..4a2523ad00 100644 --- a/app/mon/mon_gui/CMakeLists.txt +++ b/app/mon/mon_gui/CMakeLists.txt @@ -195,7 +195,7 @@ ecal_add_app_qt(${PROJECT_NAME} ${autogen_ui} ) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE protobuf::libprotobuf eCAL::core eCAL::core_pb @@ -209,7 +209,7 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) if(ECAL_NPCAP_SUPPORT) add_definitions(-DECAL_NPCAP_SUPPORT) - target_link_libraries(${PROJECT_NAME} + target_link_libraries(${PROJECT_NAME} PRIVATE udpcap::udpcap ) endif(ECAL_NPCAP_SUPPORT) diff --git a/app/mon/mon_plugins/capnproto_reflection/CMakeLists.txt b/app/mon/mon_plugins/capnproto_reflection/CMakeLists.txt index e929fd1db8..6c0edfac76 100644 --- a/app/mon/mon_plugins/capnproto_reflection/CMakeLists.txt +++ b/app/mon/mon_plugins/capnproto_reflection/CMakeLists.txt @@ -58,7 +58,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} METADATA src/metadata.json ) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::capnproto_core diff --git a/app/mon/mon_plugins/plugin_template/CMakeLists.txt b/app/mon/mon_plugins/plugin_template/CMakeLists.txt index dd22d88b7e..24cfb9d869 100644 --- a/app/mon/mon_plugins/plugin_template/CMakeLists.txt +++ b/app/mon/mon_plugins/plugin_template/CMakeLists.txt @@ -43,7 +43,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} METADATA src/metadata.json ) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::core diff --git a/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt b/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt index 10b2c32ace..36614267a3 100644 --- a/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt +++ b/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt @@ -60,7 +60,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} ) create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::protobuf_core diff --git a/app/mon/mon_plugins/raw_data_reflection/CMakeLists.txt b/app/mon/mon_plugins/raw_data_reflection/CMakeLists.txt index 20c0deca9a..396ac96bb5 100644 --- a/app/mon/mon_plugins/raw_data_reflection/CMakeLists.txt +++ b/app/mon/mon_plugins/raw_data_reflection/CMakeLists.txt @@ -55,7 +55,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} ) create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::core diff --git a/app/mon/mon_plugins/signals_plotting/CMakeLists.txt b/app/mon/mon_plugins/signals_plotting/CMakeLists.txt index 9901f41236..6d6f0f0c96 100644 --- a/app/mon/mon_plugins/signals_plotting/CMakeLists.txt +++ b/app/mon/mon_plugins/signals_plotting/CMakeLists.txt @@ -72,7 +72,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::core diff --git a/app/mon/mon_plugins/string_reflection/CMakeLists.txt b/app/mon/mon_plugins/string_reflection/CMakeLists.txt index d94dd20bf4..98c672d291 100644 --- a/app/mon/mon_plugins/string_reflection/CMakeLists.txt +++ b/app/mon/mon_plugins/string_reflection/CMakeLists.txt @@ -55,7 +55,7 @@ ecal_add_mon_plugin(${PROJECT_NAME} ) create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::string_core diff --git a/app/mon/mon_tui/CMakeLists.txt b/app/mon/mon_tui/CMakeLists.txt index 26eb1d0349..24208ac2a3 100644 --- a/app/mon/mon_tui/CMakeLists.txt +++ b/app/mon/mon_tui/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_definitions(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf tclap::tclap eCAL::protobuf_core diff --git a/app/play/play_cli/CMakeLists.txt b/app/play/play_cli/CMakeLists.txt index 20f36b8707..66afac8ac8 100644 --- a/app/play/play_cli/CMakeLists.txt +++ b/app/play/play_cli/CMakeLists.txt @@ -44,7 +44,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE src) target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:PCRE_STATIC;_UNICODE>) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE termcolor::termcolor tclap::tclap eCAL::play_core diff --git a/app/play/play_gui/CMakeLists.txt b/app/play/play_gui/CMakeLists.txt index 3dff50e5e9..063b38b92f 100644 --- a/app/play/play_gui/CMakeLists.txt +++ b/app/play/play_gui/CMakeLists.txt @@ -139,7 +139,7 @@ ecal_add_app_qt(${PROJECT_NAME} ) create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE tclap::tclap CustomTclap eCAL::play_core diff --git a/app/rec/rec_gui/CMakeLists.txt b/app/rec/rec_gui/CMakeLists.txt index 537a235e80..d01b582c42 100644 --- a/app/rec/rec_gui/CMakeLists.txt +++ b/app/rec/rec_gui/CMakeLists.txt @@ -170,7 +170,7 @@ ecal_add_app_qt(${PROJECT_NAME} ) create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE tclap::tclap protobuf::libprotobuf eCAL::core @@ -195,7 +195,7 @@ if (WIN32 AND (${QT_VERSION_MAJOR} EQUAL 5)) # Maybe we can re-enable the functionality with the following external lib: # https://github.com/oblivioncth/Qx # - target_link_libraries (${PROJECT_NAME} + target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::WinExtras ) endif() diff --git a/app/rec/rec_server_cli/CMakeLists.txt b/app/rec/rec_server_cli/CMakeLists.txt index 686297e918..7eba07adf5 100644 --- a/app/rec/rec_server_cli/CMakeLists.txt +++ b/app/rec/rec_server_cli/CMakeLists.txt @@ -83,7 +83,7 @@ target_compile_definitions(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE tclap::tclap termcolor::termcolor eCAL::rec_server_core diff --git a/app/sys/sys_cli/CMakeLists.txt b/app/sys/sys_cli/CMakeLists.txt index 023a7cf6f4..bdc1929246 100644 --- a/app/sys/sys_cli/CMakeLists.txt +++ b/app/sys/sys_cli/CMakeLists.txt @@ -70,7 +70,7 @@ target_compile_definitions(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE tclap::tclap termcolor::termcolor eCAL::sys_core diff --git a/app/sys/sys_client_cli/CMakeLists.txt b/app/sys/sys_client_cli/CMakeLists.txt index 9e2955e789..1a90d9ae32 100644 --- a/app/sys/sys_client_cli/CMakeLists.txt +++ b/app/sys/sys_client_cli/CMakeLists.txt @@ -39,7 +39,7 @@ ecal_add_app_console(${PROJECT_NAME} ${source_files} ${win_src}) create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE spdlog::spdlog tclap::tclap protobuf::libprotobuf diff --git a/app/sys/sys_gui/CMakeLists.txt b/app/sys/sys_gui/CMakeLists.txt index 85244107f6..a893413b1b 100644 --- a/app/sys/sys_gui/CMakeLists.txt +++ b/app/sys/sys_gui/CMakeLists.txt @@ -174,7 +174,7 @@ ecal_add_app_qt(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets CustomQt diff --git a/app/util/config/CMakeLists.txt b/app/util/config/CMakeLists.txt index 08daa470c1..175743666e 100644 --- a/app/util/config/CMakeLists.txt +++ b/app/util/config/CMakeLists.txt @@ -30,7 +30,7 @@ target_include_directories(${PROJECT_NAME} target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:PCRE_STATIC;_UNICODE>) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_app(${PROJECT_NAME}) diff --git a/app/util/launcher/CMakeLists.txt b/app/util/launcher/CMakeLists.txt index 678eb3b34b..f54cbcd394 100644 --- a/app/util/launcher/CMakeLists.txt +++ b/app/util/launcher/CMakeLists.txt @@ -82,7 +82,7 @@ ecal_add_app_qt(${PROJECT_NAME} ${autogen_ui} ) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets eCAL::apps diff --git a/app/util/stop/CMakeLists.txt b/app/util/stop/CMakeLists.txt index 00a098fe98..07d9de336f 100644 --- a/app/util/stop/CMakeLists.txt +++ b/app/util/stop/CMakeLists.txt @@ -30,7 +30,7 @@ target_include_directories(${PROJECT_NAME} target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:PCRE_STATIC;_UNICODE>) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_app(${PROJECT_NAME}) diff --git a/cmake/helper_functions/ecal_add_functions.cmake b/cmake/helper_functions/ecal_add_functions.cmake index 0ebf5ae0aa..089c46c5ff 100644 --- a/cmake/helper_functions/ecal_add_functions.cmake +++ b/cmake/helper_functions/ecal_add_functions.cmake @@ -16,6 +16,10 @@ # # ========================= eCAL LICENSE ================================= +include_guard(GLOBAL) + +include("${CMAKE_CURRENT_LIST_DIR}/ecal_compiler_warnings.cmake") + # This function will set the output names of the target according to eCAL conventions. function(ecal_add_app_console TARGET_NAME) add_executable(${TARGET_NAME} ${ARGN}) @@ -24,6 +28,7 @@ function(ecal_add_app_console TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} OUTPUT_NAME ecal_${TARGET_NAME}) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() # This helper function automatically adds a gtest to ecal. @@ -50,6 +55,7 @@ function(ecal_add_gtest TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} OUTPUT_NAME ecal_${TARGET_NAME}) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_app_gui TARGET_NAME) @@ -59,6 +65,7 @@ function(ecal_add_app_gui TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} OUTPUT_NAME ecal_${TARGET_NAME}) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_app_qt TARGET_NAME) @@ -70,6 +77,7 @@ function(ecal_add_app_qt TARGET_NAME) if(WIN32) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") endif() + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_mon_plugin TARGET_NAME) @@ -94,7 +102,7 @@ function(ecal_add_mon_plugin TARGET_NAME) $<$:QT_NO_DEBUG> $<$:QT_NO_DEBUG> ) - + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_rec_addon TARGET_NAME) @@ -105,7 +113,7 @@ function(ecal_add_rec_addon TARGET_NAME) OUTPUT_NAME ecal_${TARGET_NAME} RUNTIME_OUTPUT_DIRECTORY $,${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/ecalrec_addons,${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ecal/addons/rec> ) - + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_time_plugin TARGET_NAME) @@ -114,6 +122,7 @@ function(ecal_add_time_plugin TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} ) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_shared_library TARGET_NAME) @@ -122,6 +131,7 @@ function(ecal_add_shared_library TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} OUTPUT_NAME ecal_${TARGET_NAME}) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_static_library TARGET_NAME) @@ -132,6 +142,7 @@ function(ecal_add_static_library TARGET_NAME) OUTPUT_NAME ecal_${TARGET_NAME} POSITION_INDEPENDENT_CODE ON ) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() function(ecal_add_interface_library TARGET_NAME) @@ -152,5 +163,6 @@ function(ecal_add_sample TARGET_NAME) VERSION ${eCAL_VERSION_STRING} SOVERSION ${eCAL_VERSION_MAJOR} OUTPUT_NAME ecal_sample_${TARGET_NAME}) + ecal_add_compiler_warnings(${TARGET_NAME}) endfunction() diff --git a/cmake/helper_functions/ecal_compiler_warnings.cmake b/cmake/helper_functions/ecal_compiler_warnings.cmake new file mode 100644 index 0000000000..dc657e3e0c --- /dev/null +++ b/cmake/helper_functions/ecal_compiler_warnings.cmake @@ -0,0 +1,27 @@ +include_guard(GLOBAL) + +add_library(_ecal_warnings INTERFACE) + +set(cxx_compiler_flags "") + +if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") + message(STATUS "MSVC detected - Adding flags") + set(cxx_compiler_flags "/MP" "/W4") +elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang") + message(STATUS "Setting GNU/Clang flags") + set(cxx_compiler_flags "-Wall" "-Wextra") +else() + message(WARNING "Unknown compiler, will not set warning flags") +endif() + +target_compile_options(_ecal_warnings INTERFACE + "$<$:${cxx_compiler_flags}>" +) + +unset(cxx_compiler_flags) + +function(ecal_add_compiler_warnings TARGET_NAME) + target_link_libraries("${TARGET_NAME}" PRIVATE + "$" + ) +endfunction() diff --git a/contrib/ecaltime/ecaltime_pb/CMakeLists.txt b/contrib/ecaltime/ecaltime_pb/CMakeLists.txt index 59998dfefe..3c4e9982b6 100644 --- a/contrib/ecaltime/ecaltime_pb/CMakeLists.txt +++ b/contrib/ecaltime/ecaltime_pb/CMakeLists.txt @@ -57,7 +57,7 @@ target_compile_options(${PROJECT_NAME} set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) +target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) ecal_install_library(${PROJECT_NAME}) diff --git a/contrib/ecaltime/linuxptp/CMakeLists.txt b/contrib/ecaltime/linuxptp/CMakeLists.txt index 36f6b43379..e07be4a0cc 100644 --- a/contrib/ecaltime/linuxptp/CMakeLists.txt +++ b/contrib/ecaltime/linuxptp/CMakeLists.txt @@ -38,7 +38,7 @@ endif() ecal_add_time_plugin(${PROJECT_NAME} SHARED ${ecal_time_linuxptp_src} ${ecal_time_linuxptp_header}) -target_link_libraries(${PROJECT_NAME} eCAL::core yaml-cpp::yaml-cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core yaml-cpp::yaml-cpp) target_include_directories(${PROJECT_NAME} PRIVATE diff --git a/contrib/ecaltime/localtime/CMakeLists.txt b/contrib/ecaltime/localtime/CMakeLists.txt index 13bcf105b3..bd7d145f77 100644 --- a/contrib/ecaltime/localtime/CMakeLists.txt +++ b/contrib/ecaltime/localtime/CMakeLists.txt @@ -43,7 +43,7 @@ target_include_directories(${PROJECT_NAME} $ $) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads $<$,$>,$>>:rt> ) diff --git a/contrib/mma/CMakeLists.txt b/contrib/mma/CMakeLists.txt index 011ba62205..c915a69aa0 100644 --- a/contrib/mma/CMakeLists.txt +++ b/contrib/mma/CMakeLists.txt @@ -80,7 +80,7 @@ target_include_directories(${PROJECT_NAME} create_targets_protobuf() -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads eCAL::protobuf_core eCAL::app_pb diff --git a/ecal/core_pb/CMakeLists.txt b/ecal/core_pb/CMakeLists.txt index 6259f6a56a..7146a3692e 100644 --- a/ecal/core_pb/CMakeLists.txt +++ b/ecal/core_pb/CMakeLists.txt @@ -65,7 +65,7 @@ target_compile_options(${PROJECT_NAME} set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) +target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) ecal_install_library(${PROJECT_NAME}) diff --git a/ecal/samples/cpp/benchmarks/counter_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/counter_rec/CMakeLists.txt index be32ff2c19..0e118069de 100644 --- a/ecal/samples/cpp/benchmarks/counter_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/counter_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(counter_rec_src ecal_add_sample(${PROJECT_NAME} ${counter_rec_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/counter_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/counter_snd/CMakeLists.txt index ec05a75d03..e4446c3483 100644 --- a/ecal/samples/cpp/benchmarks/counter_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/counter_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(counter_snd_src ecal_add_sample(${PROJECT_NAME} ${counter_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/datarate_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/datarate_rec/CMakeLists.txt index 92a0884960..319139b90d 100644 --- a/ecal/samples/cpp/benchmarks/datarate_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/datarate_rec/CMakeLists.txt @@ -31,7 +31,7 @@ set(datarate_rec_src ecal_add_sample(${PROJECT_NAME} ${datarate_rec_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core tclap::tclap) diff --git a/ecal/samples/cpp/benchmarks/datarate_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/datarate_snd/CMakeLists.txt index 01a7d62c0d..22eada7d11 100644 --- a/ecal/samples/cpp/benchmarks/datarate_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/datarate_snd/CMakeLists.txt @@ -31,7 +31,7 @@ set(datarate_snd_src ecal_add_sample(${PROJECT_NAME} ${datarate_snd_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core tclap::tclap) diff --git a/ecal/samples/cpp/benchmarks/dynsize_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/dynsize_snd/CMakeLists.txt index caf56512b4..4d7b1c6824 100644 --- a/ecal/samples/cpp/benchmarks/dynsize_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/dynsize_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(dynsize_snd_src ecal_add_sample(${PROJECT_NAME} ${dynsize_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/latency_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/latency_rec/CMakeLists.txt index 7ad2d710fb..d8e6eae807 100644 --- a/ecal/samples/cpp/benchmarks/latency_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/latency_rec/CMakeLists.txt @@ -33,7 +33,7 @@ set(latency_rec_src ecal_add_sample(${PROJECT_NAME} ${latency_rec_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core tclap::tclap) diff --git a/ecal/samples/cpp/benchmarks/latency_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/latency_snd/CMakeLists.txt index f1829204a4..bf8ea51108 100644 --- a/ecal/samples/cpp/benchmarks/latency_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/latency_snd/CMakeLists.txt @@ -31,7 +31,7 @@ set(latency_snd_src ecal_add_sample(${PROJECT_NAME} ${latency_snd_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core tclap::tclap) diff --git a/ecal/samples/cpp/benchmarks/many_connections_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/many_connections_rec/CMakeLists.txt index 6afbc289db..f4fe9fe877 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/many_connections_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(many_connections_rec_src ecal_add_sample(${PROJECT_NAME} ${many_connections_rec_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/many_connections_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/many_connections_snd/CMakeLists.txt index 9977cde7d0..e6c3edaa05 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/many_connections_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(many_connections_snd_src ecal_add_sample(${PROJECT_NAME} ${many_connections_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/massive_pub_sub/CMakeLists.txt b/ecal/samples/cpp/benchmarks/massive_pub_sub/CMakeLists.txt index 5c2f37e547..b35ba98baf 100644 --- a/ecal/samples/cpp/benchmarks/massive_pub_sub/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/massive_pub_sub/CMakeLists.txt @@ -30,7 +30,7 @@ set(massive_pub_sub_src ecal_add_sample(${PROJECT_NAME} ${massive_pub_sub_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/benchmarks/multiple_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/multiple_rec/CMakeLists.txt index 767f57ff3a..53425f310f 100644 --- a/ecal/samples/cpp/benchmarks/multiple_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/multiple_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(multiple_rec_src ecal_add_sample(${PROJECT_NAME} ${multiple_rec_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/benchmarks/multiple_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/multiple_snd/CMakeLists.txt index 71b902572d..b6016a89ce 100644 --- a/ecal/samples/cpp/benchmarks/multiple_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/multiple_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(multiple_snd_src ecal_add_sample(${PROJECT_NAME} ${multiple_snd_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/benchmarks/performance_rec/CMakeLists.txt b/ecal/samples/cpp/benchmarks/performance_rec/CMakeLists.txt index 188ab00a56..b2d03533a4 100644 --- a/ecal/samples/cpp/benchmarks/performance_rec/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/performance_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(performance_rec_src ecal_add_sample(${PROJECT_NAME} ${performance_rec_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/performance_snd/CMakeLists.txt b/ecal/samples/cpp/benchmarks/performance_snd/CMakeLists.txt index 002a107b34..89981f78ad 100644 --- a/ecal/samples/cpp/benchmarks/performance_snd/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/performance_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(performance_snd_src ecal_add_sample(${PROJECT_NAME} ${performance_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt b/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt index f819d38ecd..dfff413e26 100644 --- a/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt @@ -37,7 +37,7 @@ set(source_files #add_executable(${PROJECT_NAME} ${source_files}) ecal_add_sample(${PROJECT_NAME} ${source_files}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core Threads::Threads ) diff --git a/ecal/samples/cpp/benchmarks/pubsub_throughput/CMakeLists.txt b/ecal/samples/cpp/benchmarks/pubsub_throughput/CMakeLists.txt index 15a8a46683..99d0d0e7bd 100644 --- a/ecal/samples/cpp/benchmarks/pubsub_throughput/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/pubsub_throughput/CMakeLists.txt @@ -30,7 +30,7 @@ set(pubsub_throughput_src ecal_add_sample(${PROJECT_NAME} ${pubsub_throughput_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/misc/config/CMakeLists.txt b/ecal/samples/cpp/misc/config/CMakeLists.txt index 2aa52c6391..802599e326 100644 --- a/ecal/samples/cpp/misc/config/CMakeLists.txt +++ b/ecal/samples/cpp/misc/config/CMakeLists.txt @@ -32,7 +32,7 @@ ecal_add_sample(${PROJECT_NAME} ${config_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/misc/process/CMakeLists.txt b/ecal/samples/cpp/misc/process/CMakeLists.txt index 4621748949..e419b3942f 100644 --- a/ecal/samples/cpp/misc/process/CMakeLists.txt +++ b/ecal/samples/cpp/misc/process/CMakeLists.txt @@ -32,7 +32,7 @@ ecal_add_sample(${PROJECT_NAME} ${process_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries (${PROJECT_NAME} +target_link_libraries (${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/misc/time/CMakeLists.txt b/ecal/samples/cpp/misc/time/CMakeLists.txt index 57b20d4d83..22e5dca69a 100644 --- a/ecal/samples/cpp/misc/time/CMakeLists.txt +++ b/ecal/samples/cpp/misc/time/CMakeLists.txt @@ -30,7 +30,7 @@ set(time_src ecal_add_sample(${PROJECT_NAME} ${time_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/misc/timer/CMakeLists.txt b/ecal/samples/cpp/misc/timer/CMakeLists.txt index f9d2a81c03..7f13b045a9 100644 --- a/ecal/samples/cpp/misc/timer/CMakeLists.txt +++ b/ecal/samples/cpp/misc/timer/CMakeLists.txt @@ -30,7 +30,7 @@ set(timer_src ecal_add_sample(${PROJECT_NAME} ${timer_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/monitoring/monitoring_get_services/CMakeLists.txt b/ecal/samples/cpp/monitoring/monitoring_get_services/CMakeLists.txt index 7f3ded17b2..cf62888001 100644 --- a/ecal/samples/cpp/monitoring/monitoring_get_services/CMakeLists.txt +++ b/ecal/samples/cpp/monitoring/monitoring_get_services/CMakeLists.txt @@ -30,7 +30,7 @@ set(monitoring_get_services_src ecal_add_sample(${PROJECT_NAME} ${monitoring_get_services_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/monitoring/monitoring_get_topics/CMakeLists.txt b/ecal/samples/cpp/monitoring/monitoring_get_topics/CMakeLists.txt index 0ca50acc57..9854c5fe7f 100644 --- a/ecal/samples/cpp/monitoring/monitoring_get_topics/CMakeLists.txt +++ b/ecal/samples/cpp/monitoring/monitoring_get_topics/CMakeLists.txt @@ -30,7 +30,7 @@ set(monitoring_get_topics_src ecal_add_sample(${PROJECT_NAME} ${monitoring_get_topics_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt b/ecal/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt index 66684dc8e4..c619eab0dd 100644 --- a/ecal/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt +++ b/ecal/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt @@ -31,7 +31,7 @@ set(monitoring_performance_src ecal_add_sample(${PROJECT_NAME} ${monitoring_performance_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core eCAL::core_pb protobuf::libprotobuf diff --git a/ecal/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt b/ecal/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt index f886805004..a301b29962 100644 --- a/ecal/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt +++ b/ecal/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt @@ -31,7 +31,7 @@ set(monitoring_rec_src ecal_add_sample(${PROJECT_NAME} ${monitoring_rec_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core eCAL::core_pb protobuf::libprotobuf diff --git a/ecal/samples/cpp/pubsub/binary/binary_rec/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/binary_rec/CMakeLists.txt index 8170925bee..64a409bd90 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_rec/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/binary_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(binary_rec_src ecal_add_sample(${PROJECT_NAME} ${binary_rec_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/pubsub/binary/binary_snd/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/binary_snd/CMakeLists.txt index e559a1b2a4..99b3072b84 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_snd/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/binary_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(binary_snd_src ecal_add_sample(${PROJECT_NAME} ${binary_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/CMakeLists.txt index 849da83367..07aeab409e 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/CMakeLists.txt @@ -31,7 +31,7 @@ find_package(eCAL REQUIRED) # add and configure sample project ecal_add_sample(${PROJECT_NAME} ${binary_zero_copy_rec_src}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) # install and set properties ecal_install_sample(${PROJECT_NAME}) diff --git a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/CMakeLists.txt index d3268c50eb..cd7dd2fa93 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/CMakeLists.txt @@ -31,7 +31,7 @@ find_package(eCAL REQUIRED) # add and configure sample project ecal_add_sample(${PROJECT_NAME} ${binary_zero_copy_snd_src}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) # install and set properties ecal_install_sample(${PROJECT_NAME}) diff --git a/ecal/samples/cpp/pubsub/binary/ping/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/ping/CMakeLists.txt index 9147869d48..78d97632e5 100644 --- a/ecal/samples/cpp/pubsub/binary/ping/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/ping/CMakeLists.txt @@ -30,7 +30,7 @@ set(ping_src ecal_add_sample(${PROJECT_NAME} ${ping_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/pubsub/binary/pong/CMakeLists.txt b/ecal/samples/cpp/pubsub/binary/pong/CMakeLists.txt index f76609ef9e..7f7ccc8a58 100644 --- a/ecal/samples/cpp/pubsub/binary/pong/CMakeLists.txt +++ b/ecal/samples/cpp/pubsub/binary/pong/CMakeLists.txt @@ -30,7 +30,7 @@ set(pong_src ecal_add_sample(${PROJECT_NAME} ${pong_src}) -target_link_libraries(${PROJECT_NAME} eCAL::core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/ecal/samples/cpp/services/latency_client/CMakeLists.txt b/ecal/samples/cpp/services/latency_client/CMakeLists.txt index 999b78ad8a..8d59e3b7e0 100644 --- a/ecal/samples/cpp/services/latency_client/CMakeLists.txt +++ b/ecal/samples/cpp/services/latency_client/CMakeLists.txt @@ -30,7 +30,7 @@ set(latency_client_src ecal_add_sample(${PROJECT_NAME} ${latency_client_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/services/latency_server/CMakeLists.txt b/ecal/samples/cpp/services/latency_server/CMakeLists.txt index bd769ab04a..b79347c456 100644 --- a/ecal/samples/cpp/services/latency_server/CMakeLists.txt +++ b/ecal/samples/cpp/services/latency_server/CMakeLists.txt @@ -30,7 +30,7 @@ set(latency_server_src ecal_add_sample(${PROJECT_NAME} ${latency_server_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/services/minimal_client/CMakeLists.txt b/ecal/samples/cpp/services/minimal_client/CMakeLists.txt index ce2abf3b5a..c5e0e615c1 100644 --- a/ecal/samples/cpp/services/minimal_client/CMakeLists.txt +++ b/ecal/samples/cpp/services/minimal_client/CMakeLists.txt @@ -30,7 +30,7 @@ set(minimal_client_src ecal_add_sample(${PROJECT_NAME} ${minimal_client_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/ecal/samples/cpp/services/minimal_server/CMakeLists.txt b/ecal/samples/cpp/services/minimal_server/CMakeLists.txt index 730a5eab3a..6d0386ad5d 100644 --- a/ecal/samples/cpp/services/minimal_server/CMakeLists.txt +++ b/ecal/samples/cpp/services/minimal_server/CMakeLists.txt @@ -30,7 +30,7 @@ set(minimal_server_src ecal_add_sample(${PROJECT_NAME} ${minimal_server_src}) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core ) diff --git a/lang/c/samples/pubsub/string/minimal_rec/CMakeLists.txt b/lang/c/samples/pubsub/string/minimal_rec/CMakeLists.txt index 52105bca82..3159add569 100644 --- a/lang/c/samples/pubsub/string/minimal_rec/CMakeLists.txt +++ b/lang/c/samples/pubsub/string/minimal_rec/CMakeLists.txt @@ -34,7 +34,7 @@ ecal_add_sample(${PROJECT_NAME} ${minimal_rec_c_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries(${PROJECT_NAME} eCAL::core_c) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core_c) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/c/samples/pubsub/string/minimal_rec_cb/CMakeLists.txt b/lang/c/samples/pubsub/string/minimal_rec_cb/CMakeLists.txt index 4a0b429e8e..ba7082db9e 100644 --- a/lang/c/samples/pubsub/string/minimal_rec_cb/CMakeLists.txt +++ b/lang/c/samples/pubsub/string/minimal_rec_cb/CMakeLists.txt @@ -34,7 +34,7 @@ ecal_add_sample(${PROJECT_NAME} ${minimal_rec_cb_c_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries(${PROJECT_NAME} eCAL::core_c) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core_c) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/c/samples/pubsub/string/minimal_snd/CMakeLists.txt b/lang/c/samples/pubsub/string/minimal_snd/CMakeLists.txt index 655dee5085..9400209bfd 100644 --- a/lang/c/samples/pubsub/string/minimal_snd/CMakeLists.txt +++ b/lang/c/samples/pubsub/string/minimal_snd/CMakeLists.txt @@ -34,7 +34,7 @@ ecal_add_sample(${PROJECT_NAME} ${minimal_snd_c_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries(${PROJECT_NAME} eCAL::core_c) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core_c) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/c/samples/services/minimal_client_c/CMakeLists.txt b/lang/c/samples/services/minimal_client_c/CMakeLists.txt index 48d97b6b11..f3c8fecc09 100644 --- a/lang/c/samples/services/minimal_client_c/CMakeLists.txt +++ b/lang/c/samples/services/minimal_client_c/CMakeLists.txt @@ -33,7 +33,7 @@ set(minimal_client_c_src ecal_add_sample(${PROJECT_NAME} ${minimal_client_c_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries(${PROJECT_NAME} eCAL::core_c) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core_c) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/c/samples/services/minimal_server_c/CMakeLists.txt b/lang/c/samples/services/minimal_server_c/CMakeLists.txt index acc620b455..92a255dc53 100644 --- a/lang/c/samples/services/minimal_server_c/CMakeLists.txt +++ b/lang/c/samples/services/minimal_server_c/CMakeLists.txt @@ -33,7 +33,7 @@ set(minimal_server_c_src ecal_add_sample(${PROJECT_NAME} ${minimal_server_c_src}) target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries(${PROJECT_NAME} eCAL::core_c) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core_c) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/csharp/Continental.eCAL.Core.Samples/CMakeLists.txt b/lang/csharp/Continental.eCAL.Core.Samples/CMakeLists.txt index 0f7d461548..e93fd88db0 100644 --- a/lang/csharp/Continental.eCAL.Core.Samples/CMakeLists.txt +++ b/lang/csharp/Continental.eCAL.Core.Samples/CMakeLists.txt @@ -23,7 +23,7 @@ find_package(eCAL REQUIRED) macro(ecal_add_csharp_core_sample sample_name) ecal_add_sample(${sample_name} ${sample_name}.cs) - target_link_libraries(${sample_name} Continental.eCAL.Core) + target_link_libraries(${sample_name} PRIVATE Continental.eCAL.Core) set_property(TARGET ${sample_name} PROPERTY FOLDER samples/csharp/core) endmacro() diff --git a/lang/csharp/Continental.eCAL.Protobuf.Samples/CMakeLists.txt b/lang/csharp/Continental.eCAL.Protobuf.Samples/CMakeLists.txt index 87dd0a05db..7b3d289007 100644 --- a/lang/csharp/Continental.eCAL.Protobuf.Samples/CMakeLists.txt +++ b/lang/csharp/Continental.eCAL.Protobuf.Samples/CMakeLists.txt @@ -23,7 +23,10 @@ find_package(eCAL REQUIRED) macro(ecal_add_csharp_protobuf_sample sample_name) ecal_add_sample(${sample_name} ${sample_name}.cs) - target_link_libraries(${sample_name} Continental.eCAL.Protobuf Continental.eCAL.Protobuf.Samples.Datatypes) + target_link_libraries(${sample_name} PRIVATE + Continental.eCAL.Protobuf + Continental.eCAL.Protobuf.Samples.Datatypes + ) set_property(TARGET ${sample_name} PROPERTY FOLDER samples/csharp/protobuf) set_target_properties(${sample_name} PROPERTIES diff --git a/samples/cpp/measurement/benchmark/CMakeLists.txt b/samples/cpp/measurement/benchmark/CMakeLists.txt index 866cf80937..4d0d292ae7 100644 --- a/samples/cpp/measurement/benchmark/CMakeLists.txt +++ b/samples/cpp/measurement/benchmark/CMakeLists.txt @@ -26,7 +26,7 @@ find_package(eCAL REQUIRED) ecal_add_sample(${PROJECT_NAME} src/main.cpp) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::hdf5 ) diff --git a/serialization/string/samples/pubsub/minimal_rec/CMakeLists.txt b/serialization/string/samples/pubsub/minimal_rec/CMakeLists.txt index 4a42bbf19a..19cfb3729c 100644 --- a/serialization/string/samples/pubsub/minimal_rec/CMakeLists.txt +++ b/serialization/string/samples/pubsub/minimal_rec/CMakeLists.txt @@ -30,7 +30,7 @@ set(minimal_rec_src ecal_add_sample(${PROJECT_NAME} ${minimal_rec_src}) -target_link_libraries(${PROJECT_NAME} eCAL::string_core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::string_core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/serialization/string/samples/pubsub/minimal_rec_cb/CMakeLists.txt b/serialization/string/samples/pubsub/minimal_rec_cb/CMakeLists.txt index e624d313ef..d86d7e998a 100644 --- a/serialization/string/samples/pubsub/minimal_rec_cb/CMakeLists.txt +++ b/serialization/string/samples/pubsub/minimal_rec_cb/CMakeLists.txt @@ -30,7 +30,7 @@ set(minimal_rec_cb_src ecal_add_sample(${PROJECT_NAME} ${minimal_rec_cb_src}) -target_link_libraries(${PROJECT_NAME} eCAL::string_core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::string_core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/serialization/string/samples/pubsub/minimal_snd/CMakeLists.txt b/serialization/string/samples/pubsub/minimal_snd/CMakeLists.txt index c0ae227b9c..94a2bdd1af 100644 --- a/serialization/string/samples/pubsub/minimal_snd/CMakeLists.txt +++ b/serialization/string/samples/pubsub/minimal_snd/CMakeLists.txt @@ -30,7 +30,7 @@ set(minimal_snd_src ecal_add_sample(${PROJECT_NAME} ${minimal_snd_src}) -target_link_libraries(${PROJECT_NAME} eCAL::string_core) +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::string_core) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)