Skip to content

Commit

Permalink
add_subdirectory support will be in separate pr
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Aug 26, 2024
1 parent 4a5f802 commit 6901e69
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 6901e69

Please sign in to comment.