add BUILD_TESTS option
@@ -7,6 +7,8 @@ project(toppra
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+# Tests
+option(BUILD_TESTS "Build Gtests" ON)
# Dynamics
option(BUILD_WITH_PINOCCHIO "Compile with Pinocchio library" OFF)
# Solvers
@@ -51,6 +53,8 @@ add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(bindings)
+if(BUILD_TESTS)
+
# Download and unpack googletest at configure time
# source: https://github.com/google/googletest/tree/master/googletest
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
@@ -87,6 +91,8 @@ endif()
enable_testing()
add_subdirectory(tests)
+endif()
+
# Generate and install CMake config, version and target files.
include(CMakePackageConfigHelpers)
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
