@@ -40,8 +40,8 @@ For more information, please visit <http://www.openshot.org/>.
4040set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /cmake/Modules" )
4141
4242################ PROJECT VERSION ####################
43- set (PROJECT_VERSION_FULL "0.2.3-dev1 " )
44- set (PROJECT_SO_VERSION 17 )
43+ set (PROJECT_VERSION_FULL "0.2.5-dev2 " )
44+ set (PROJECT_SO_VERSION 19 )
4545
4646# Remove the dash and anything following, to get the #.#.# version for project()
4747STRING (REGEX REPLACE "\- .*$" "" VERSION_NUM "${PROJECT_VERSION_FULL} " )
@@ -73,16 +73,37 @@ 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+ if (ENABLE_COVERAGE)
83+ message (WARNING "ENABLE_COVERAGE requires tests, overriding DISABLE_TESTS" )
84+ set (ENABLE_TESTS ON )
85+ else ()
86+ set (ENABLE_TESTS OFF )
87+ endif ()
88+ endif ()
89+
90+ if (DEFINED ENABLE_TESTS)
91+ set (ENABLE_TESTS ${ENABLE_TESTS} CACHE BOOL "Build unit tests (requires UnitTest++)" FORCE)
92+ endif ()
7993
8094########## Configure Version.h header ##############
8195configure_file (include /OpenShotVersion.h.in include /OpenShotVersion.h @ONLY)
8296# We'll want that installed later
8397install (FILES ${CMAKE_CURRENT_BINARY_DIR} /include /OpenShotVersion.h
8498 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /libopenshot)
8599
100+ #### Work around a GCC < 9 bug with handling of _Pragma() in macros
101+ #### See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
102+ if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" ) AND
103+ (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.0.0" ))
104+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-integrated-cpp" )
105+ endif ()
106+
86107#### Enable C++11 (for std::shared_ptr support)
87108set (CMAKE_CXX_STANDARD 11)
88109set (CMAKE_CXX_STANDARD_REQUIRED ON )
@@ -108,7 +129,7 @@ if (ENABLE_COVERAGE)
108129 message (STATUS "Coverage enabled, setting build type to Debug" )
109130 endif ()
110131 include (CodeCoverage)
111- APPEND_COVERAGE_COMPILER_FLAGS ()
132+ append_coverage_compiler_flags ()
112133endif ()
113134add_feature_info("Coverage" ENABLE_COVERAGE "analyze test coverage and generate report" )
114135
@@ -117,27 +138,33 @@ add_subdirectory(src)
117138
118139################### DOCUMENTATION ###################
119140# Find Doxygen (used for documentation)
120- include (cmake/Modules/UseDoxygen.cmake)
121-
122- # Doxygen was found
123- if (TARGET doc )
124- message (STATUS "Doxygen found, documentation target enabled" )
125- message ("\n To compile documentation in doc/html, run: 'make doc'" )
126-
127- # Install docs, if the user builds them with `make doc`
128- install (CODE "MESSAGE(\" Checking for documentation files to install...\" )" )
129- install (CODE "MESSAGE(\" (Compile with 'make doc' command, requires Doxygen)\" )" )
130-
131- install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /doc /html/
132- DESTINATION ${CMAKE_INSTALL_DOCDIR} /API
133- MESSAGE_NEVER # Don't spew about file copies
134- OPTIONAL ) # No error if the docs aren't found
141+ set (DOCS_ENABLED FALSE ) # Only set true if Doxygen is found and configured
142+ if (ENABLE_DOCS)
143+ include (cmake/Modules/UseDoxygen.cmake)
144+
145+ # Doxygen was found
146+ if (TARGET doc )
147+ message (STATUS "Doxygen found, documentation target enabled" )
148+ set (DOCS_ENABLED TRUE )
149+
150+ # Install docs, if the user builds them with `make doc`
151+ install (CODE "MESSAGE(\" Checking for documentation files to install...\" )" )
152+ install (CODE "MESSAGE(\" (Compile with 'make doc' command, requires Doxygen)\" )" )
153+
154+ install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /doc /html/
155+ DESTINATION ${CMAKE_INSTALL_DOCDIR} /API
156+ MESSAGE_NEVER # Don't spew about file copies
157+ OPTIONAL ) # No error if the docs aren't found
158+ endif ()
135159endif ()
160+ add_feature_info("Documentation" DOCS_ENABLED "Build API documentation with 'make doc'" )
136161
137162############# PROCESS tests/ DIRECTORY ##############
138- if (NOT DISABLE_TESTS)
163+ if (ENABLE_TESTS)
164+ set (TESTS_ENABLED TRUE ) # May be overridden by tests/CMakeLists.txt
139165 add_subdirectory (tests)
140166endif ()
167+ add_feature_info("Unit tests" TESTS_ENABLED "Compile unit tests for library functions" )
141168
142169############## COVERAGE REPORTING #################
143170if (ENABLE_COVERAGE)
0 commit comments