[build] Allow disabling tests and examples

When you have gtsam as a dependency in CMake these would get built. This
doesn't make sense and increases build times, allowing them to be
disabled fixes this.

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
release/4.3a0
Jade Turner 2024-12-07 00:33:21 +08:00
parent bb5cfb2284
commit ddd95f4a51
No known key found for this signature in database
GPG Key ID: 7DC9755FBE4DA20D
1 changed files with 9 additions and 2 deletions

View File

@ -112,10 +112,17 @@ add_subdirectory(CppUnitLite)
add_subdirectory(gtsam)
# Build Tests
add_subdirectory(tests)
option(BUILD_TESTS "Builds unit tests" ON)
if (BUILD_TESTS)
add_subdirectory(tests)
endif()
# Build examples
add_subdirectory(examples)
option(BUILD_EXAMPLES "Builds examples" ON)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Build timing
add_subdirectory(timing)