Skip to content

Commit d0e884d

Browse files
authored
Merge pull request #452 from OpenShot/release-20200229
Release branch for libopenshot 0.2.5 (SO 19)
2 parents 63e28a0 + 1ced9d4 commit d0e884d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1176
-1465
lines changed

.travis.yml

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ addons:
1919
- doxygen
2020
- graphviz
2121
- curl
22-
- jq
2322
packages: &ff_common # Common set of FFmpeg packages
2423
- *p_common
2524
- libfdk-aac-dev
@@ -34,28 +33,13 @@ addons:
3433
- libswresample-dev
3534

3635
matrix:
37-
3836
include:
39-
- name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
40-
env:
41-
- BUILD_VERSION=ffmpeg2
42-
- CMAKE_EXTRA_ARGS=""
43-
- TEST_TARGET="os_test"
44-
os: linux
45-
dist: xenial
46-
addons:
47-
apt:
48-
sources:
49-
- sourceline: 'ppa:openshot.developers/libopenshot-daily'
50-
- sourceline: 'ppa:beineri/opt-qt-5.10.0-xenial'
51-
packages:
52-
- *ff_common
5337

54-
- name: "FFmpeg 3 GCC (Ubuntu 18.04 Bionic)"
38+
- name: "Coverage (Ubuntu 18.04 Bionic)"
5539
env:
56-
- BUILD_VERSION=ffmpeg3
57-
- CMAKE_EXTRA_ARGS=""
58-
- TEST_TARGET=test
40+
- BUILD_VERSION=coverage_ffmpeg34
41+
- CMAKE_EXTRA_ARGS="-DENABLE_COVERAGE=1"
42+
- TEST_TARGET=coverage
5943
os: linux
6044
dist: bionic
6145
addons:
@@ -66,6 +50,8 @@ matrix:
6650
packages:
6751
- *ff_common
6852
- qt5-default
53+
- lcov
54+
- binutils-common # For c++filt
6955

7056
- name: "FFmpeg 4 GCC (Ubuntu 18.04 Bionic)"
7157
env:
@@ -83,6 +69,7 @@ matrix:
8369
packages:
8470
- *ff_common
8571
- qt5-default
72+
- libjsoncpp-dev
8673
- libavcodec58
8774
- libavformat58
8875
- libavdevice58
@@ -93,14 +80,13 @@ matrix:
9380
- libavresample4
9481
- libswresample3
9582

96-
- name: "FFmpeg 3 Clang (Ubuntu 18.04 Bionic)"
83+
- name: "FFmpeg 3.4 GCC (Ubuntu 18.04 Bionic)"
9784
env:
98-
- BUILD_VERSION=clang_ffmpeg3
85+
- BUILD_VERSION=ffmpeg34
9986
- CMAKE_EXTRA_ARGS=""
10087
- TEST_TARGET=test
10188
os: linux
10289
dist: bionic
103-
compiler: clang
10490
addons:
10591
apt:
10692
sources:
@@ -109,16 +95,16 @@ matrix:
10995
packages:
11096
- *ff_common
11197
- qt5-default
112-
- libomp-dev
98+
- libjsoncpp-dev
11399

114-
115-
- name: "Coverage (Ubuntu 18.04 Bionic)"
100+
- name: "FFmpeg 3.4 Clang (Ubuntu 18.04 Bionic)"
116101
env:
117-
- BUILD_VERSION=coverage_ffmpeg3
118-
- CMAKE_EXTRA_ARGS="-DENABLE_COVERAGE=1"
119-
- TEST_TARGET=coverage
102+
- BUILD_VERSION=clang_ffmpeg34
103+
- CMAKE_EXTRA_ARGS=""
104+
- TEST_TARGET=test
120105
os: linux
121106
dist: bionic
107+
compiler: clang
122108
addons:
123109
apt:
124110
sources:
@@ -127,12 +113,47 @@ matrix:
127113
packages:
128114
- *ff_common
129115
- qt5-default
130-
- lcov
131-
- binutils-common # For c++filt
116+
- libomp-dev
117+
118+
- name: "FFmpeg 3.2 GCC (Ubuntu 16.04 Xenial)"
119+
env:
120+
- BUILD_VERSION=ffmpeg32
121+
- CMAKE_EXTRA_ARGS=""
122+
- TEST_TARGET="os_test"
123+
os: linux
124+
dist: xenial
125+
addons:
126+
apt:
127+
sources:
128+
- sourceline: 'ppa:openshot.developers/libopenshot-daily'
129+
- sourceline: 'ppa:beineri/opt-qt-5.10.0-xenial'
130+
- sourceline: 'ppa:jon-hedgerows/ffmpeg-backports'
131+
packages:
132+
- *ff_common
133+
- libavcodec57
134+
- libavdevice57
135+
- libavfilter6
136+
- libavformat57
137+
- libavresample3
138+
- libavutil55
139+
- libpostproc54
140+
- libswresample2
141+
- libswscale4
132142

133-
before_script:
134-
- CODACY_VERSION="$(curl -Ls https://api.bintray.com/packages/codacy/Binaries/codacy-coverage-reporter/versions/_latest | jq -r .name)"
135-
- if [ "x${TEST_TARGET}" = "xcoverage" ]; then curl -Ls -o codacy-coverage-reporter "https://dl.bintray.com/codacy/Binaries/${CODACY_VERSION}/codacy-coverage-reporter-linux"; chmod +x codacy-coverage-reporter; fi
143+
- name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
144+
env:
145+
- BUILD_VERSION=ffmpeg2
146+
- CMAKE_EXTRA_ARGS=""
147+
- TEST_TARGET="os_test"
148+
os: linux
149+
dist: xenial
150+
addons:
151+
apt:
152+
sources:
153+
- sourceline: 'ppa:openshot.developers/libopenshot-daily'
154+
- sourceline: 'ppa:beineri/opt-qt-5.10.0-xenial'
155+
packages:
156+
- *ff_common
136157

137158
script:
138159
- mkdir -p build; cd build;
@@ -143,4 +164,4 @@ script:
143164
- cd ..
144165

145166
after_success:
146-
- if [ "x${TEST_TARGET}" = "xcoverage" ]; then ./codacy-coverage-reporter report -l CPP -r build/coverage.info; fi
167+
- if [ "x$TEST_TARGET" = "xcoverage" ]; then bash <(curl -s https://codecov.io/bash) -f build/coverage.info || echo "Codecov did not collect coverage reports"; fi

CMakeLists.txt

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ For more information, please visit <http://www.openshot.org/>.
4040
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
4141

4242
################ PROJECT VERSION ####################
43-
set(PROJECT_VERSION_FULL "0.2.4")
44-
set(PROJECT_SO_VERSION 18)
43+
set(PROJECT_VERSION_FULL "0.2.5")
44+
set(PROJECT_SO_VERSION 19)
4545

4646
# Remove the dash and anything following, to get the #.#.# version for project()
4747
STRING(REGEX REPLACE "\-.*$" "" VERSION_NUM "${PROJECT_VERSION_FULL}")
@@ -73,16 +73,37 @@ include(FeatureSummary)
7373
# Optional build settings for libopenshot
7474
option(USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON)
7575
option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)
76-
option(DISABLE_TESTS "Don't build unit tests" OFF)
7776
option(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 ##############
8195
configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
8296
# We'll want that installed later
8397
install(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)
87108
set(CMAKE_CXX_STANDARD 11)
88109
set(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()
112133
endif()
113134
add_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("\nTo 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()
135159
endif()
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)
140166
endif()
167+
add_feature_info("Unit tests" TESTS_ENABLED "Compile unit tests for library functions")
141168

142169
############## COVERAGE REPORTING #################
143170
if (ENABLE_COVERAGE)

cmake/Modules/CodeCoverage.cmake

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
# 2019-12-19, FeRD (Frank Dana)
6060
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
6161
#
62+
# 2020-01-19, Bob Apthorpe
63+
# - Added gfortran support
64+
#
65+
# 2020-02-17, FeRD (Frank Dana)
66+
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
67+
# in EXCLUDEs, and remove manual escaping from gcovr targets
68+
#
6269
# USAGE:
6370
#
6471
# 1. Copy this file into your cmake modules path.
@@ -122,12 +129,22 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
122129
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
123130
endif()
124131
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
125-
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
132+
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
133+
# Do nothing; exit conditional without error if true
134+
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
135+
# Do nothing; exit conditional without error if true
136+
else()
137+
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
138+
endif()
126139
endif()
127140

128141
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
129142
CACHE INTERNAL "")
130143

144+
set(CMAKE_Fortran_FLAGS_COVERAGE
145+
${COVERAGE_COMPILER_FLAGS}
146+
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
147+
FORCE )
131148
set(CMAKE_CXX_FLAGS_COVERAGE
132149
${COVERAGE_COMPILER_FLAGS}
133150
CACHE STRING "Flags used by the C++ compiler during coverage builds."
@@ -145,6 +162,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
145162
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
146163
FORCE )
147164
mark_as_advanced(
165+
CMAKE_Fortran_FLAGS_COVERAGE
148166
CMAKE_CXX_FLAGS_COVERAGE
149167
CMAKE_C_FLAGS_COVERAGE
150168
CMAKE_EXE_LINKER_FLAGS_COVERAGE
@@ -154,7 +172,7 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
154172
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
155173
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
156174

157-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
175+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
158176
link_libraries(gcov)
159177
endif()
160178

@@ -242,6 +260,7 @@ function(setup_target_for_coverage_lcov)
242260

243261
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
244262
DEPENDS ${Coverage_DEPENDENCIES}
263+
VERBATIM # Protect arguments to commands
245264
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
246265
)
247266

@@ -304,9 +323,8 @@ function(setup_target_for_coverage_gcovr_xml)
304323
# Combine excludes to several -e arguments
305324
set(GCOVR_EXCLUDE_ARGS "")
306325
foreach(EXCLUDE ${GCOVR_EXCLUDES})
307-
string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
308326
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
309-
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
327+
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
310328
endforeach()
311329

312330
add_custom_target(${Coverage_NAME}
@@ -321,6 +339,7 @@ function(setup_target_for_coverage_gcovr_xml)
321339
BYPRODUCTS ${Coverage_NAME}.xml
322340
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
323341
DEPENDS ${Coverage_DEPENDENCIES}
342+
VERBATIM # Protect arguments to commands
324343
COMMENT "Running gcovr to produce Cobertura code coverage report."
325344
)
326345

@@ -376,9 +395,8 @@ function(setup_target_for_coverage_gcovr_html)
376395
# Combine excludes to several -e arguments
377396
set(GCOVR_EXCLUDE_ARGS "")
378397
foreach(EXCLUDE ${GCOVR_EXCLUDES})
379-
string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
380398
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
381-
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
399+
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
382400
endforeach()
383401

384402
add_custom_target(${Coverage_NAME}
@@ -393,9 +411,11 @@ function(setup_target_for_coverage_gcovr_html)
393411
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
394412
--object-directory=${PROJECT_BINARY_DIR}
395413
-o ${Coverage_NAME}/index.html
414+
396415
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
397416
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
398417
DEPENDS ${Coverage_DEPENDENCIES}
418+
VERBATIM # Protect arguments to commands
399419
COMMENT "Running gcovr to produce HTML code coverage report."
400420
)
401421

@@ -410,5 +430,6 @@ endfunction() # setup_target_for_coverage_gcovr_html
410430
function(append_coverage_compiler_flags)
411431
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
412432
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
433+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
413434
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
414435
endfunction() # append_coverage_compiler_flags

0 commit comments

Comments
 (0)