2020-09-10 03:10:56 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
index b18a30a96..d89248aa1 100644
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-11-16 06:18:12 +08:00
|
|
|
@@ -66,11 +66,21 @@ conan_init(cmake)
|
2020-09-10 03:10:56 +08:00
|
|
|
add_subdirectory(src)
|
2021-11-16 06:18:12 +08:00
|
|
|
|
2020-09-10 03:10:56 +08:00
|
|
|
# add usage example
|
|
|
|
-add_subdirectory(example)
|
|
|
|
+option(BUILD_EXAMPLES "Build usage examples" OFF)
|
|
|
|
+if(BUILD_EXAMPLES)
|
|
|
|
+ add_subdirectory(example)
|
|
|
|
+endif()
|
2021-11-16 06:18:12 +08:00
|
|
|
|
2020-09-10 03:10:56 +08:00
|
|
|
# generate project documentation
|
|
|
|
-add_subdirectory(docs)
|
|
|
|
+option(BUILD_DOCS "Generate docs" OFF)
|
|
|
|
+if(BUILD_DOCS)
|
|
|
|
+ add_subdirectory(docs)
|
|
|
|
+endif()
|
2021-11-16 06:18:12 +08:00
|
|
|
|
|
|
|
# add unit tests
|
|
|
|
-enable_testing()
|
|
|
|
-add_subdirectory(test)
|
|
|
|
+option(BUILD_TESTING "Build tests" OFF)
|
|
|
|
+if(BUILD_TESTING)
|
|
|
|
+ set_warnings(mp-units)
|
|
|
|
+ enable_testing()
|
|
|
|
+ add_subdirectory(test)
|
|
|
|
+endif()
|