Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to cmake #3

Merged
merged 32 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3de896a
Add libMXF and libMXFpp submodules
philipnbbc Jan 3, 2023
c8e497c
Add cmake build scripts
philipnbbc Dec 20, 2022
70b8c4b
Remove legacy build and test files
philipnbbc Jan 2, 2023
4be5aa8
Add missing memory deallocs spotted by valgrind
philipnbbc Dec 20, 2022
393259d
Replace forward with backward slash for file URI
philipnbbc Dec 20, 2022
774405f
Explicit type casts to avoid MSVC warnings
philipnbbc Dec 20, 2022
f79e6d4
Build apps and tools by default
philipnbbc Dec 21, 2022
8c3d65e
Add large file support compiler flags
philipnbbc Jan 2, 2023
1993125
Various updates to support older platform/cmake
philipnbbc Jan 2, 2023
fad4ffd
Use cmake ARCHIVE and LIBRARY install destinations
philipnbbc Dec 23, 2022
e13a041
Add MSVC /EHsc flag (for VS 2017) to fully unwind stack
philipnbbc Dec 23, 2022
17abe50
Add a large file (>4GB) test
philipnbbc Dec 30, 2022
a4e7132
Catch missing libMXF/pp deps earlier
philipnbbc Jan 2, 2023
a7279e1
Remove unused source file AS11Labels.cpp
philipnbbc Jan 2, 2023
d4cbc10
Modify top CMakeLists because MSVC only defined after project
philipnbbc Jan 2, 2023
c3010c7
Update Dockerfile to use cmake build
philipnbbc Jan 3, 2023
3f67edb
Update README for cmake build
philipnbbc Jan 3, 2023
f432116
Ensure git checkout uses LF for test text files
philipnbbc Jan 4, 2023
8b83d33
Ignore unused variable warning from clang
philipnbbc Jan 11, 2023
a08a5f7
Remove register deprecated in c+11 and removed/reserved in c++17
philipnbbc Jan 11, 2023
b16ad59
Fix deprecated ptr_fun by using trim_string instead
philipnbbc Jan 11, 2023
f8d0d8a
Replace __FILE__ with __FILENAME__ relative project path
philipnbbc Jan 12, 2023
8f3d17a
Update libMXF and libMXFpp submodules
philipnbbc Jan 12, 2023
589a906
Use git describe relative to release tag
philipnbbc Jan 16, 2023
f6321f7
libMXF and libMXF++ submodules updated
philipnbbc Jan 16, 2023
75774da
cmake: reset git-version-tracking checkout before patching
philipnbbc Jan 20, 2023
6bfdef6
libMXF and libMXFpp submodules updated
philipnbbc Jan 20, 2023
f76bf57
Reduce git version tracking name to overcome Win path limits
philipnbbc Jan 24, 2023
2ecf25d
libMXF and libMXFpp submodules updated
philipnbbc Jan 24, 2023
0b48433
docker: remove legacy avidmxfinfo and writeavidmxf
philipnbbc Jan 24, 2023
8e8b3df
Minor mods to the docs
philipnbbc Jan 25, 2023
b28e9ce
libMXF and libMXFpp submodules updated
philipnbbc Jan 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
69 changes: 12 additions & 57 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,59 +1,14 @@
*~
*.o
*.la
*.lo
*.pc
Makefile
aclocal.m4
autom4te.cache
build/
msvc_build/*/.vs/
*.vcxproj.user
Debug/
Release/
.libs/
config.guess
config.h.in
config.sub
configure
depcomp
Makefile.in
install-sh
ltmain.sh
m4/libtool.m4
m4/lt~obsolete.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
missing
config.h
config.log
config.status
*.deps
libtool
stamp-h1
bmx_scm_version.h

/apps/bmxparse/bmxparse
/apps/bmxtimecode
/apps/bmxtranswrap/bmxtranswrap
/apps/mxf2raw/mxf2raw
/apps/raw2bmx/raw2bmx

/ar-lib
/compile
/test-driver

/test/*/*.log
/test/*/*.trs
/test/create_test_essence
/test/file_md5
/test/file_truncate
/test/rdd6/test_rdd6_xml

/tools/h264dump
/tools/j2cdump
/tools/jp2extract
/tools/movdump
/tools/rdd36dump
/tools/vc2dump
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
out/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libMXF"]
path = deps/libMXF
url = ../libMXF.git
[submodule "libMXFpp"]
path = deps/libMXFpp
url = ../libMXFpp.git
96 changes: 96 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15.0)
# Set policy CMP0091 to new to allow use of CMAKE_MSVC_RUNTIME_LIBRARY
cmake_policy(SET CMP0091 NEW)
endif()

project(bmx
VERSION 0.1
DESCRIPTION "A C++ library and set of utilities to read and write the SMPTE ST 377-1 MXF file format"
HOMEPAGE_URL https://github.com/bbc/bmx
LANGUAGES C CXX
)

include("${CMAKE_CURRENT_LIST_DIR}/cmake/options.cmake")

if(MSVC AND BMX_SET_MSVC_RUNTIME AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.15.0)
# cmake version >= 3.15: Use MultiThreadedDLL runtime
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()

if(BUILD_SHARED_LIBS)
# Ensure that static library code can be linked into the dynamic libraries (-fPIC compile option)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(CMAKE_CXX_STANDARD 11)

# Set the test samples output directory
if(BMX_TEST_SAMPLES_DIR STREQUAL "")
set(new_samples_dir ${CMAKE_CURRENT_BINARY_DIR}/test_samples)
else()
get_filename_component(new_samples_dir
${BMX_TEST_SAMPLES_DIR}
REALPATH
BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
if(NOT new_samples_dir STREQUAL ${BMX_TEST_SAMPLES_DIR})
set(BMX_TEST_SAMPLES_DIR ${new_samples_dir})
message("-- Test samples output directory: ${BMX_TEST_SAMPLES_DIR}")
endif()

if(MSVC)
add_compile_options(/W3 /EHsc)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

if(BMX_SET_MSVC_RUNTIME AND CMAKE_VERSION VERSION_LESS 3.15.0)
# cmake version < 3.15: Update compiler flags to use the MultiThreadedDLL runtime
macro(update_msvc_runtime_flags flags)
string(REGEX REPLACE "/MT" "/MD" ${flags} "${${flags}}")
endmacro()

update_msvc_runtime_flags(CMAKE_C_FLAGS)
update_msvc_runtime_flags(CMAKE_CXX_FLAGS)
foreach(suffix _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
update_msvc_runtime_flags(CMAKE_C_FLAGS${suffix})
update_msvc_runtime_flags(CMAKE_CXX_FLAGS${suffix})
endforeach()
endif()
else()
add_compile_options(-W -Wall -O2)

# Enable large file support on 32-bit systems.
add_definitions(
-D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
)
endif()

if(BMX_BUILD_TESTING AND (NOT DEFINED BUILD_TESTING OR BUILD_TESTING))
enable_testing()
endif()
add_custom_target(bmx_test_samples)
add_custom_target(bmx_test_data)

include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake")
if(BMX_BUILD_WITH_LIBCURL)
include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake")
endif()

configure_file(config.h.in config.h)

add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(test)
if(BMX_BUILD_APPS)
add_subdirectory(apps)
endif()
if(BMX_BUILD_TOOLS)
add_subdirectory(tools)
endif()
39 changes: 10 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
##################################################
FROM debian:latest as build

ARG LIBMXF_GIT=https://github.com/bbc/libMXF.git
ARG LIBMXFPP_GIT=https://github.com/bbc/libMXFpp.git

WORKDIR /build

# Install build dependencies
Expand All @@ -14,39 +11,23 @@ RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
git \
pkg-config \
automake \
libtool \
g++ \
gcc \
make \
autoconf \
cmake \
uuid-dev \
liburiparser-dev \
libexpat1-dev \
libcurl4-openssl-dev

# Clone, configure and make install libMXF, libMXF++ and bmx

RUN git clone $LIBMXF_GIT libMXF && \
cd libMXF && \
./autogen.sh && \
./configure PKG_CONFIG_PATH=/build/install/lib/pkgconfig --prefix /build/install --disable-static && \
make check && \
make install

RUN git clone $LIBMXFPP_GIT libMXFpp && \
cd libMXFpp && \
./autogen.sh && \
./configure PKG_CONFIG_PATH=/build/install/lib/pkgconfig --prefix /build/install --disable-static --disable-examples && \
make check && \
make install

COPY . bmx/
RUN cd bmx && \
./autogen.sh && \
./configure PKG_CONFIG_PATH=/build/install/lib/pkgconfig --prefix /build/install --disable-static && \
make check && \
make install
# Copy, configure and make install
COPY . bmx
RUN mkdir build && cd build && \
cmake -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/build/install \
-DBMX_BUILD_WITH_LIBCURL=ON \
-DLIBMXF_BUILD_ARCHIVE=ON \
../bmx && \
make && make test && make install


##################################################
Expand Down
28 changes: 0 additions & 28 deletions Makefile.am

This file was deleted.

Loading