From 6901e692d416d7c9eb51d7f03aade0cf9ee879a7 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Mon, 26 Aug 2024 12:25:12 +0200 Subject: [PATCH] add_subdirectory support will be in separate pr --- CMakeLists.txt | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24b13564..3c0f9c9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ elseif(PROJECT_VERSION_TWEAK GREATER 1) endif() status_print(project_version) -declare_cache_var_true_if_vscode(ZENOHCXX_BUILD_IN_SOURCE_TREE "Load zenoh-c and zenoh-pico from source tree") declare_cache_var(ZENOHCXX_ZENOHC ON BOOL "Build for Zenoh-c target") declare_cache_var(ZENOHCXX_ZENOHPICO OFF BOOL "Build for Zenoh-pico target") @@ -37,18 +36,7 @@ add_library(zenohcxx INTERFACE) target_include_directories(zenohcxx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") if(ZENOHCXX_ZENOHPICO) - # zenohcxx for zenohpico - if (ZENOHCXX_BUILD_IN_SOURCE_TREE) - # use github submodule from source tree - message(STATUS "Loading zenoh-pico from ${CMAKE_CURRENT_SOURCE_DIR}/zenoh-pico becasue ZENOHCXX_BUILD_IN_SOURCE_TREE is ON") - list(APPEND CMAKE_MESSAGE_INDENT " -- ") - add_subdirectory(zenoh-pico) - list(POP_BACK CMAKE_MESSAGE_INDENT) - # TODO: make target name unification in zenohpico's root CMAkeLists.txt and PackageConfig.cmake - add_library(zenohpico::lib ALIAS zenohpico) - else() - find_package(zenohpico REQUIRED) - endif() + find_package(zenohpico REQUIRED) if(TARGET zenohpico::lib) message(STATUS "defined lib target zenohcxx::zenohpico for zenohpico::lib") add_library(zenohcxx_zenohpico INTERFACE) @@ -63,16 +51,7 @@ if(ZENOHCXX_ZENOHPICO) endif() if(ZENOHCXX_ZENOHC) - # zenohcxx for zenohc - if (ZENOHCXX_BUILD_IN_SOURCE_TREE) - # use github submodule from source tree - message(STATUS "Loading zenoh-c from ${CMAKE_CURRENT_SOURCE_DIR}/zenoh-c becasue ZENOHCXX_BUILD_IN_SOURCE_TREE is ON") - list(APPEND CMAKE_MESSAGE_INDENT " -- ") - add_subdirectory(zenoh-c) - list(POP_BACK CMAKE_MESSAGE_INDENT) - else() - find_package(zenohc REQUIRED) - endif() + find_package(zenohc REQUIRED) if(TARGET zenohc::lib) message(STATUS "defined lib target zenohcxx::zenohc::lib for zenohc::lib") add_library(zenohcxx_zenohc INTERFACE)