Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions src/opentime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ set(OPENTIME_HEADER_FILES
rationalTime.h
stringPrintf.h
timeRange.h
timeTransform.h
version.h)
timeTransform.h)

add_library(opentime ${OTIO_SHARED_OR_STATIC_LIB}
errorStatus.cpp
Expand All @@ -16,7 +15,12 @@ add_library(opentime ${OTIO_SHARED_OR_STATIC_LIB}

add_library(OTIO::opentime ALIAS opentime)

target_include_directories(opentime PRIVATE "${PROJECT_SOURCE_DIR}/src")
target_include_directories(
opentime
PRIVATE
"${PROJECT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_BINARY_DIR}/.."
)

set_target_properties(opentime PROPERTIES
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"
Expand All @@ -43,6 +47,11 @@ target_compile_options(opentime PRIVATE
$<$<CXX_COMPILER_ID:MSVC>: /EHsc>
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h
)

if(OTIO_CXX_INSTALL)
install(FILES ${OPENTIME_HEADER_FILES}
DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentime")
Expand Down Expand Up @@ -74,5 +83,12 @@ if(OTIO_CXX_INSTALL)
DESTINATION
${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentime
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/version.h
DESTINATION
"${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentime"
)
endif()

13 changes: 0 additions & 13 deletions src/opentime/version.h

This file was deleted.

16 changes: 16 additions & 0 deletions src/opentime/version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

#pragma once

#define OPENTIME_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define OPENTIME_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define OPENTIME_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define OPENTIME_VERSION v@PROJECT_VERSION_MAJOR@_@PROJECT_VERSION_MINOR@_@PROJECT_VERSION_PATCH@

namespace opentime {
namespace OPENTIME_VERSION {
}

using namespace OPENTIME_VERSION;
} // namespace opentime
23 changes: 19 additions & 4 deletions src/opentimelineio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ set(OPENTIMELINEIO_HEADER_FILES
transition.h
typeRegistry.h
unknownSchema.h
vectorIndexing.h
version.h)
vectorIndexing.h)

add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
color.cpp
Expand Down Expand Up @@ -79,8 +78,12 @@ add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}

add_library(OTIO::opentimelineio ALIAS opentimelineio)

target_include_directories(opentimelineio
PRIVATE "${PROJECT_SOURCE_DIR}/src")
target_include_directories(
opentimelineio
PRIVATE
"${PROJECT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_BINARY_DIR}/.."
)

if(OTIO_FIND_RAPIDJSON)
target_include_directories(opentimelineio
Expand Down Expand Up @@ -120,6 +123,11 @@ target_compile_options(opentimelineio PRIVATE
$<$<CXX_COMPILER_ID:MSVC>: /EHsc>
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h
)

if(OTIO_CXX_INSTALL)
install(FILES ${OPENTIMELINEIO_HEADER_FILES}
DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentimelineio")
Expand Down Expand Up @@ -153,4 +161,11 @@ if(OTIO_CXX_INSTALL)
DESTINATION
${OTIO_RESOLVED_CXX_INSTALL_DIR}/share/opentimelineio
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/version.h
DESTINATION
"${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentimelineio"
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

#pragma once

#define OPENTIMELINEIO_VERSION v1_0
#define OPENTIMELINEIO_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define OPENTIMELINEIO_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define OPENTIMELINEIO_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define OPENTIMELINEIO_VERSION v@PROJECT_VERSION_MAJOR@_@PROJECT_VERSION_MINOR@_@PROJECT_VERSION_PATCH@

#include "opentime/rationalTime.h"
#include "opentime/timeRange.h"
Expand Down
4 changes: 3 additions & 1 deletion src/py-opentimelineio/opentime-bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ target_include_directories(_opentime
PRIVATE pybind11/include
PRIVATE "${PROJECT_SOURCE_DIR}/src"
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps"
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include")
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include"
PRIVATE "${CMAKE_BINARY_DIR}/src"
)

target_link_libraries(_opentime PUBLIC opentimelineio opentime)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ target_include_directories(_otio
PRIVATE "${PROJECT_SOURCE_DIR}/src"
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps"
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include"
PRIVATE "${CMAKE_BINARY_DIR}/src"
)

target_link_libraries(_otio PUBLIC opentimelineio opentime)
Expand Down
4 changes: 2 additions & 2 deletions src/py-opentimelineio/opentimelineio/adapters/otioz.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def read_from_file(

if not os.path.exists(extract_to_directory):
raise exceptions.OTIOError(
f"Directory '{extract_to_directory()}' does not exist, cannot"
" unpack otioz there."
f"Directory '{extract_to_directory}' does not exist, cannot"
f" unpack otioz there."
)

if os.path.exists(output_media_directory):
Expand Down
7 changes: 5 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
include_directories(${PROJECT_SOURCE_DIR}/src
include_directories(
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/deps
${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include
${PROJECT_SOURCE_DIR}/src/tests)
${PROJECT_SOURCE_DIR}/src/tests
${CMAKE_BINARY_DIR}/src
)

list(APPEND tests_opentime test_opentime)
foreach(test ${tests_opentime})
Expand Down
4 changes: 2 additions & 2 deletions tests/test_composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main(int argc, char** argv)
SerializableObject::Retainer<Item> item = new Item;

comp->append_child(item);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = comp->find_children<>(&err);
assertEqual(result.size(), 1);
assertEqual(result[0].value, item.value);
Expand All @@ -47,7 +47,7 @@ main(int argc, char** argv)
track->append_child(transition);
track->append_child(clip);

opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto items = stack->find_clips(&err);
assertFalse(is_error(err));
assertEqual(items.size(), 1);
Expand Down
6 changes: 3 additions & 3 deletions tests/test_serializableCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::SerializableCollection>
sc = new otio::SerializableCollection();
sc->insert_child(0, tl);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = sc->find_children<otio::Clip>(&err, {}, false);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl.value);
Expand Down Expand Up @@ -61,7 +61,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::SerializableCollection>
sc = new otio::SerializableCollection();
sc->insert_child(0, tl);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = sc->find_children<otio::Clip>(&err, range);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl0.value);
Expand All @@ -80,7 +80,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::SerializableCollection>
sc = new otio::SerializableCollection();
sc->insert_child(0, tl);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = sc->find_children<otio::Clip>(&err, std::nullopt, true);
assertEqual(result.size(), 0);
result = sc->find_children<otio::Clip>(&err, std::nullopt, false);
Expand Down
6 changes: 3 additions & 3 deletions tests/test_timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::Timeline> tl =
new otio::Timeline();
tl->tracks()->append_child(tr);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tl->find_children<otio::Clip>(&err);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl.value);
Expand All @@ -54,7 +54,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::Timeline> tl =
new otio::Timeline();
tl->tracks()->append_child(tr);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tl->find_children<otio::Clip>(&err, range);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl0.value);
Expand All @@ -70,7 +70,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::Timeline> tl =
new otio::Timeline();
tl->tracks()->append_child(tr);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tl->find_children<otio::Clip>(&err, std::nullopt, true);
assertEqual(result.size(), 0);
result = tl->find_children<otio::Clip>(&err, std::nullopt, false);
Expand Down
6 changes: 3 additions & 3 deletions tests/test_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ main(int argc, char** argv)
otio::SerializableObject::Retainer<otio::Track> tr =
new otio::Track();
tr->append_child(cl);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tr->find_children<otio::Clip>(&err);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl.value);
Expand All @@ -48,7 +48,7 @@ main(int argc, char** argv)
tr->append_child(cl0);
tr->append_child(cl1);
tr->append_child(cl2);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tr->find_children<otio::Clip>(
&err,
TimeRange(RationalTime(0.0, 24.0), RationalTime(24.0, 24.0)));
Expand Down Expand Up @@ -98,7 +98,7 @@ main(int argc, char** argv)
new otio::Track();
tr->append_child(cl0);
tr->append_child(st);
opentimelineio::v1_0::ErrorStatus err;
OTIO_NS::ErrorStatus err;
auto result = tr->find_children<otio::Clip>(&err, std::nullopt, true);
assertEqual(result.size(), 1);
assertEqual(result[0].value, cl0.value);
Expand Down
Loading