@@ -73,9 +73,14 @@ include(FeatureSummary)
7373# Optional build settings for libopenshot
7474option (USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON )
7575option (DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF )
76- option (DISABLE_TESTS "Don't build unit tests" OFF )
7776option (ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF )
78- option (ENABLE_COVERAGE "Enable coverage reporting" OFF )
77+ option (ENABLE_TESTS "Build unit tests (requires UnitTest++)" ON )
78+ option (ENABLE_DOCS "Build API documentation (requires Doxygen)" ON )
79+
80+ # Legacy commandline override
81+ if (DISABLE_TESTS)
82+ set (ENABLE_TESTS OFF CACHE BOOL "Build unit tests (requires UnitTest++)" FORCE)
83+ endif ()
7984
8085########## Configure Version.h header ##############
8186configure_file (include /OpenShotVersion.h.in include /OpenShotVersion.h @ONLY)
@@ -124,27 +129,32 @@ add_subdirectory(src)
124129
125130################### DOCUMENTATION ###################
126131# Find Doxygen (used for documentation)
127- include (cmake/Modules/UseDoxygen.cmake)
128-
129- # Doxygen was found
130- if (TARGET doc )
131- message (STATUS "Doxygen found, documentation target enabled" )
132- message ("\n To compile documentation in doc/html, run: 'make doc'" )
133-
134- # Install docs, if the user builds them with `make doc`
135- install (CODE "MESSAGE(\" Checking for documentation files to install...\" )" )
136- install (CODE "MESSAGE(\" (Compile with 'make doc' command, requires Doxygen)\" )" )
137-
138- install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /doc /html/
139- DESTINATION ${CMAKE_INSTALL_DOCDIR} /API
140- MESSAGE_NEVER # Don't spew about file copies
141- OPTIONAL ) # No error if the docs aren't found
132+ set (DOCS_ENABLED FALSE ) # Only set true if Doxygen is found and configured
133+ if (ENABLE_DOCS)
134+ include (cmake/Modules/UseDoxygen.cmake)
135+
136+ # Doxygen was found
137+ if (TARGET doc )
138+ message (STATUS "Doxygen found, documentation target enabled" )
139+ set (DOCS_ENABLED TRUE )
140+
141+ # Install docs, if the user builds them with `make doc`
142+ install (CODE "MESSAGE(\" Checking for documentation files to install...\" )" )
143+ install (CODE "MESSAGE(\" (Compile with 'make doc' command, requires Doxygen)\" )" )
144+
145+ install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /doc /html/
146+ DESTINATION ${CMAKE_INSTALL_DOCDIR} /API
147+ MESSAGE_NEVER # Don't spew about file copies
148+ OPTIONAL ) # No error if the docs aren't found
149+ endif ()
142150endif ()
151+ add_feature_info("Documentation" DOCS_ENABLED "Build API documentation with 'make doc'" )
143152
144153############# PROCESS tests/ DIRECTORY ##############
145- if (NOT DISABLE_TESTS )
154+ if (ENABLE_TESTS )
146155 add_subdirectory (tests)
147156endif ()
157+ add_feature_info("Unit tests" ENABLE_TESTS "Compile unit tests for library functions" )
148158
149159############## COVERAGE REPORTING #################
150160if (ENABLE_COVERAGE)
0 commit comments