diff --git a/PackageConfig.cmake.in b/PackageConfig.cmake.in index 7ac56c378..800ceff6c 100644 --- a/PackageConfig.cmake.in +++ b/PackageConfig.cmake.in @@ -26,3 +26,24 @@ if(NOT ("@IMPLIB@" STREQUAL "")) set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_IMPLIB "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@") endif() target_include_directories(__zenohpico_lib INTERFACE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@") + +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + add_compile_definitions(ZENOH_LINUX) +elseif(POSIX_COMPATIBLE) + add_compile_definitions(ZENOH_LINUX) +elseif(CMAKE_SYSTEM_NAME MATCHES "BSD") + add_compile_definitions(ZENOH_BSD) +elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") + add_compile_definitions(ZENOH_MACOS) +elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten") + add_compile_definitions(EMSCRIPTEN) +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") + add_compile_definitions(ZENOH_WINDOWS) +elseif(CMAKE_SYSTEM_NAME MATCHES "Generic") + if(WITH_ZEPHYR) + add_compile_definitions(ZENOH_ZEPHYR) + elseif(WITH_FREERTOS_PLUS_TCP) + add_compile_definitions(ZENOH_FREERTOS_PLUS_TCP) + endif() +endif() + diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fb780510d..05e76b29b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -4,7 +4,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) project(zenohpico_examples LANGUAGES C) include(../cmake/helpers.cmake) set_default_build_type(Release) - configure_include_project(ZENOHPICO zenohpico zenohpico ".." zenohc "https://github.com/eclipse-zenoh/zenoh-pico" "") + configure_include_project(ZENOHPICO zenohpico zenohpico::static ".." zenohpico "https://github.com/eclipse-zenoh/zenoh-pico" "") add_custom_target(examples ALL) else() message(STATUS "zenoh-pico examples")