Skip to content

Commit

Permalink
Merge pull request #582 from OpenShot/new-header-move
Browse files Browse the repository at this point in the history
Reorganize repo (headers moved to src/, bindings/ and examples/ made root-level dirs) & update build system
  • Loading branch information
ferdnyc authored Oct 19, 2020
2 parents 1f9e4e2 + 9050cc7 commit 07a447c
Show file tree
Hide file tree
Showing 191 changed files with 673 additions and 623 deletions.
44 changes: 23 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,14 @@ option(USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON)
option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)
option(ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF)
option(ENABLE_TESTS "Build unit tests (requires UnitTest++)" ON)
option(ENABLE_COVERAGE "Scan test coverage using gcov and report" OFF)
option(ENABLE_DOCS "Build API documentation (requires Doxygen)" ON)
option(APPIMAGE_BUILD "Build to install in an AppImage (Linux only)" OFF)
option(ENABLE_MAGICK "Use ImageMagick, if available" ON)

# Legacy commandline override
if (DISABLE_TESTS)
if(ENABLE_COVERAGE)
message(WARNING "ENABLE_COVERAGE requires tests, overriding DISABLE_TESTS")
set(ENABLE_TESTS ON)
else()
set(ENABLE_TESTS OFF)
endif()
set(ENABLE_TESTS OFF)
endif()

if(DEFINED ENABLE_TESTS)
Expand All @@ -110,9 +106,9 @@ IF (WIN32)
ENDIF(WIN32)

############## Code Coverage #########################
if (DISABLE_TESTS AND ENABLE_COVERAGE)
message(WARNING "ENABLE_COVERAGE requires tests, overriding DISABLE_TESTS")
set(DISABLE_TESTS OFF CACHE BOOL "Don't build unit tests" FORCE)
if (ENABLE_COVERAGE AND NOT ENABLE_TESTS)
message(WARNING "ENABLE_COVERAGE requires unit tests, forcing ENABLE_TESTS")
set(ENABLE_TESTS ON CACHE BOOL "Don't build unit tests" FORCE)
endif()

if (ENABLE_COVERAGE)
Expand All @@ -125,25 +121,29 @@ if (ENABLE_COVERAGE)
endif()
add_feature_info("Coverage" ENABLE_COVERAGE "analyze test coverage and generate report")

# Juce requires either DEBUG or NDEBUG to be defined on MacOS.
# -DNDEBUG is set by cmake for all release configs, so add
# -DDEBUG for debug builds. We'll do this for all OSes, even
# though only MacOS requires it.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
# Make sure we've picked some build type, default to release
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release")
endif()

############## PROCESS src/ DIRECTORIES ##############
###
### Process subdirectories
###
add_subdirectory(src)

########## Configure Version.h header ##############
configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
add_subdirectory(examples)
add_subdirectory(bindings)

###
### Configure Version.h header
###
# (Note: This comes after the subdirectories, because it needs variables
# set during the dependency discovery in src/CMakeLists.txt)
configure_file(src/OpenShotVersion.h.in src/OpenShotVersion.h @ONLY)
# We'll want that installed later
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/OpenShotVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot)


################### DOCUMENTATION ###################
# Find Doxygen (used for documentation)
set(DOCS_ENABLED FALSE) # Only set true if Doxygen is found and configured
Expand Down Expand Up @@ -180,8 +180,10 @@ if (ENABLE_COVERAGE)
NAME coverage
LCOV_ARGS "--no-external"
EXECUTABLE openshot-test
DEPENDENCIES openshot-test)
message("Generate coverage report with 'make coverage'")
DEPENDENCIES openshot-test
EXCLUDE "bindings" "examples" "${CMAKE_CURRENT_BINARY_DIR}/bindings"
)
message("Generate coverage report with 'make coverage'")
endif()

########### PRINT FEATURE SUMMARY ##############
Expand Down
28 changes: 12 additions & 16 deletions Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ INLINE_INHERITED_MEMB = NO
# shortest path that makes the file name unique will be used
# The default value is: YES.

FULL_PATH_NAMES = NO
FULL_PATH_NAMES = YES

# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
Expand All @@ -160,7 +160,7 @@ FULL_PATH_NAMES = NO
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.

STRIP_FROM_PATH =
STRIP_FROM_PATH = "@PROJECT_SOURCE_DIR@/src"

# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
Expand All @@ -169,7 +169,7 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.

STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH = "@PROJECT_SOURCE_DIR@/src"

# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
Expand Down Expand Up @@ -803,9 +803,9 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/include" \
"@CMAKE_CURRENT_SOURCE_DIR@/src" \
"@CMAKE_CURRENT_SOURCE_DIR@/doc"
INPUT = "@PROJECT_SOURCE_DIR@/src" \
"@PROJECT_SOURCE_DIR@/doc" \
"@PROJECT_BINARY_DIR@/src/OpenShotVersion.h"


# This tag can be used to specify the character encoding of the source files
Expand Down Expand Up @@ -862,11 +862,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = "*/.*" \
"*/.*/*" \
"*/src/examples/*" \
"*/src/bindings/*" \
"*.py"
EXCLUDE_PATTERNS =

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand All @@ -883,27 +879,27 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/tests"
EXAMPLE_PATH = "@PROJECT_SOURCE_DIR@/examples"

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.

EXAMPLE_PATTERNS =
EXAMPLE_PATTERNS = "*.cpp"

# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.

EXAMPLE_RECURSIVE = NO
EXAMPLE_RECURSIVE = YES

# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).

IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@"
IMAGE_PATH = "@PROJECT_SOURCE_DIR@"

# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
Expand Down Expand Up @@ -2086,7 +2082,7 @@ INCLUDE_PATH =
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

INCLUDE_FILE_PATTERNS =
INCLUDE_FILE_PATTERNS = "*.h"

# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
Expand Down
Loading

0 comments on commit 07a447c

Please sign in to comment.