From 8d71ca3b44bed784471379746d67c4db90d012df Mon Sep 17 00:00:00 2001 From: DownerCase <119755054+DownerCase@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:12:14 +0000 Subject: [PATCH] [CMake] yaml-cpp compatibility with CMake < 3.18 (#1323) --- CMakeLists.txt | 2 +- app/meas_cutter/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af447a1a42..5cf0c7d0b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ # # ========================= eCAL LICENSE ================================= -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.15) include(CMakeDependentOption) diff --git a/app/meas_cutter/CMakeLists.txt b/app/meas_cutter/CMakeLists.txt index fdac3f7c05..4209e6c380 100644 --- a/app/meas_cutter/CMakeLists.txt +++ b/app/meas_cutter/CMakeLists.txt @@ -24,7 +24,9 @@ find_package(yaml-cpp REQUIRED) #compatibility with yaml-cpp < 0.8.0 if (NOT TARGET yaml-cpp::yaml-cpp AND TARGET yaml-cpp) - add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp) + # ALIASing a imported non-global library requires CMake 3.18 so we do this + add_library(yaml-cpp::yaml-cpp INTERFACE IMPORTED) + target_link_libraries(yaml-cpp::yaml-cpp INTERFACE yaml-cpp) endif()