Skip to content

Commit 0001ae4

Browse files
committed
declare_cache_var instead of option
1 parent 3d48c61 commit 0001ae4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ status_print(project_version)
3131
declare_cache_var(ZENOHCXX_ZENOHC ON BOOL "Build for Zenoh-c target")
3232
declare_cache_var(ZENOHCXX_ZENOHPICO OFF BOOL "Build for Zenoh-pico target")
3333
declare_cache_var(ZENOHCXX_EXAMPLES_PROTOBUF ON BOOL "Build Protobuf example (turn off if you have problems with installed Protobuf version)")
34+
declare_cache_var(ENABLE_TESTS "Enable building tests" ON)
35+
declare_cache_var(ENABLE_EXAMPLES "Enable building examples" ON)
3436

3537
set_default_build_type(Release)
3638

37-
option(ENABLE_TESTS "Enable building tests" ON)
38-
option(ENABLE_EXAMPLES "Enable building examples" ON)
39-
4039
# zenohcxx without dependencies
4140
add_library(zenohcxx INTERFACE)
4241
target_include_directories(zenohcxx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
@@ -73,9 +72,9 @@ endif()
7372

7473

7574
add_subdirectory(install)
76-
enable_testing()
7775

7876
if(ENABLE_TESTS)
77+
enable_testing()
7978
add_subdirectory(tests)
8079
else()
8180
message(STATUS "Tests are disabled.")

0 commit comments

Comments
 (0)