Skip to content

Commit

Permalink
Conditionally build examples as tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardicus committed Jan 21, 2025
1 parent 5dbfe25 commit fd4271c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ status_print(project_version)
declare_cache_var(ZENOHCXX_ZENOHC ON BOOL "Build for Zenoh-c target")
declare_cache_var(ZENOHCXX_ZENOHPICO OFF BOOL "Build for Zenoh-pico target")
declare_cache_var(ZENOHCXX_EXAMPLES_PROTOBUF ON BOOL "Build Protobuf example (turn off if you have problems with installed Protobuf version)")
declare_cache_var(ENABLE_TESTS ON BOOL "Enable building tests")
declare_cache_var(ENABLE_EXAMPLES ON BOOL "Enable building examples")

set_default_build_type(Release)

Expand Down Expand Up @@ -70,7 +72,17 @@ endif()


add_subdirectory(install)
enable_testing()
add_subdirectory(tests)
add_subdirectory(examples)

if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
else()
message(STATUS "Tests are disabled.")
endif()
if(ENABLE_EXAMPLES)
add_subdirectory(examples)
else()
message(STATUS "Examples are disabled.")
endif()

add_subdirectory(docs)

0 comments on commit fd4271c

Please sign in to comment.