File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ cmake_minimum_required(VERSION 3.18.2)
66# Project Metadata
77# TODO: read this information from a configuration file, here, and in setup.py
88
9- set (OTIO_VERSION_MAJOR "0" )
10- set (OTIO_VERSION_MINOR "19" )
11- set (OTIO_VERSION_PATCH "0" )
9+ file (READ "src/opentimelineio/version.h" VERSION_H )
10+ string (REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${VERSION_H} )
11+ set (OTIO_VERSION_MAJOR ${CMAKE_MATCH_1} )
12+ string (REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${VERSION_H} )
13+ set (OTIO_VERSION_MINOR ${CMAKE_MATCH_1} )
14+ string (REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${VERSION_H} )
15+ set (OTIO_VERSION_PATCH ${CMAKE_MATCH_1} )
1216set (OTIO_VERSION ${OTIO_VERSION_MAJOR} .${OTIO_VERSION_MINOR} .${OTIO_VERSION_PATCH} )
1317
1418set (OTIO_AUTHOR "Contributors to the OpenTimelineIO project" )
Original file line number Diff line number Diff line change @@ -111,19 +111,17 @@ C++:
111111
112112#include " opentimelineio/timeline.h"
113113
114- namespace otio = opentimelineio::OPENTIMELINEIO_VERSION;
115-
116114void
117115main ()
118116{
119- otio ::SerializableObject::Retainer<otio ::Timeline> tl(
120- dynamic_cast<otio ::Timeline*>(
121- otio ::Timeline::from_json_file ("taco.otio")
117+ OTIO_NS ::SerializableObject::Retainer<OTIO_NS ::Timeline> tl(
118+ dynamic_cast<OTIO_NS ::Timeline*>(
119+ OTIO_NS ::Timeline::from_json_file ("taco.otio")
122120 )
123121 );
124122 for (const auto& cl : tl->find_clips())
125123 {
126- otio ::RationalTime dur = cl->duration();
124+ OTIO_NS ::RationalTime dur = cl->duration();
127125 std::cout << "Name: " << cl->name() << " [ ";
128126 std::cout << dur.value() << "/" << dur.rate() << "] " << std::endl;
129127 }
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ set(OPENTIME_HEADER_FILES
77 rationalTime.h
88 stringPrintf.h
99 timeRange.h
10- timeTransform.h)
10+ timeTransform.h
11+ version.h)
1112
1213add_library (opentime ${OTIO_SHARED_OR_STATIC_LIB}
1314 errorStatus.cpp
@@ -16,12 +17,7 @@ add_library(opentime ${OTIO_SHARED_OR_STATIC_LIB}
1617
1718add_library (OTIO::opentime ALIAS opentime )
1819
19- target_include_directories (
20- opentime
21- PRIVATE
22- "${PROJECT_SOURCE_DIR} /src"
23- "${CMAKE_CURRENT_BINARY_DIR} /.."
24- )
20+ target_include_directories (opentime PRIVATE "${PROJECT_SOURCE_DIR} /src" )
2521
2622set_target_properties (opentime PROPERTIES
2723 DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX} "
@@ -56,11 +52,6 @@ target_compile_options(opentime PRIVATE
5652 $<$<CXX_COMPILER_ID :MSVC >: /EHsc >
5753)
5854
59- configure_file (
60- ${CMAKE_CURRENT_SOURCE_DIR} /version.h.in
61- ${CMAKE_CURRENT_BINARY_DIR} /version.h
62- )
63-
6455if (OTIO_CXX_INSTALL)
6556 install (FILES ${OPENTIME_HEADER_FILES}
6657 DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR} /include/opentime" )
@@ -98,12 +89,5 @@ if(OTIO_CXX_INSTALL)
9889 DESTINATION
9990 ${OTIO_RESOLVED_CXX_INSTALL_DIR} /share/opentime
10091 )
101-
102- install (
103- FILES
104- ${CMAKE_CURRENT_BINARY_DIR} /version.h
105- DESTINATION
106- "${OTIO_RESOLVED_CXX_INSTALL_DIR} /include/opentime"
107- )
10892endif ()
10993
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+ // Copyright Contributors to the OpenTimelineIO project
3+
4+ #pragma once
5+
6+ #define OPENTIME_VERSION_MAJOR 0
7+ #define OPENTIME_VERSION_MINOR 19
8+ #define OPENTIME_VERSION_PATCH 0
9+ #define OPENTIME_VERSION v0_19_0
10+ #define OPENTIME_VERSION_NS v0_19
11+
12+ namespace opentime {
13+ namespace OPENTIME_VERSION_NS {
14+ }
15+
16+ using namespace OPENTIME_VERSION_NS ;
17+ } // namespace opentime
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ set(OPENTIMELINEIO_HEADER_FILES
3737 transition.h
3838 typeRegistry.h
3939 unknownSchema.h
40- vectorIndexing.h)
40+ vectorIndexing.h
41+ version.h)
4142
4243add_library (opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
4344 color.cpp
@@ -79,12 +80,7 @@ add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
7980
8081add_library (OTIO::opentimelineio ALIAS opentimelineio )
8182
82- target_include_directories (
83- opentimelineio
84- PRIVATE
85- "${PROJECT_SOURCE_DIR} /src"
86- "${CMAKE_CURRENT_BINARY_DIR} /.."
87- )
83+ target_include_directories (opentimelineio PRIVATE "${PROJECT_SOURCE_DIR} /src" )
8884
8985if (OTIO_FIND_RAPIDJSON)
9086 target_include_directories (opentimelineio
@@ -132,11 +128,6 @@ target_compile_options(opentimelineio PRIVATE
132128 $<$<CXX_COMPILER_ID :MSVC >: /EHsc >
133129)
134130
135- configure_file (
136- ${CMAKE_CURRENT_SOURCE_DIR} /version.h.in
137- ${CMAKE_CURRENT_BINARY_DIR} /version.h
138- )
139-
140131if (OTIO_CXX_INSTALL)
141132 install (FILES ${OPENTIMELINEIO_HEADER_FILES}
142133 DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR} /include/opentimelineio" )
@@ -176,11 +167,4 @@ if(OTIO_CXX_INSTALL)
176167 DESTINATION
177168 ${OTIO_RESOLVED_CXX_INSTALL_DIR} /share/opentimelineio
178169 )
179-
180- install (
181- FILES
182- ${CMAKE_CURRENT_BINARY_DIR} /version.h
183- DESTINATION
184- "${OTIO_RESOLVED_CXX_INSTALL_DIR} /include/opentimelineio"
185- )
186170endif ()
Original file line number Diff line number Diff line change 33
44#pragma once
55
6- #define OPENTIMELINEIO_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
7- #define OPENTIMELINEIO_VERSION_MINOR @PROJECT_VERSION_MINOR@
8- #define OPENTIMELINEIO_VERSION_PATCH @PROJECT_VERSION_PATCH@
9- #define OPENTIMELINEIO_VERSION v@PROJECT_VERSION_MAJOR@_@PROJECT_VERSION_MINOR@_@PROJECT_VERSION_PATCH@
10- #define OPENTIMELINEIO_VERSION_NS v@PROJECT_VERSION_MAJOR@_@PROJECT_VERSION_MINOR@
6+ #define OPENTIMELINEIO_VERSION_MAJOR 0
7+ #define OPENTIMELINEIO_VERSION_MINOR 19
8+ #define OPENTIMELINEIO_VERSION_PATCH 0
9+ #define OPENTIMELINEIO_VERSION v0_19_0
10+ #define OPENTIMELINEIO_VERSION_NS v0_19
1111
1212#include " opentime/rationalTime.h"
1313#include " opentime/timeRange.h"
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ target_include_directories(_opentime
1313 PRIVATE "${PROJECT_SOURCE_DIR} /src"
1414 PRIVATE "${PROJECT_SOURCE_DIR} /src/deps"
1515 PRIVATE "${PROJECT_SOURCE_DIR} /src/deps/optional-lite/include"
16- PRIVATE "${CMAKE_BINARY_DIR} /src"
1716)
1817
1918target_link_libraries (_opentime PUBLIC opentimelineio opentime )
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ target_include_directories(_otio
2323 PRIVATE "${PROJECT_SOURCE_DIR} /src"
2424 PRIVATE "${PROJECT_SOURCE_DIR} /src/deps"
2525 PRIVATE "${PROJECT_SOURCE_DIR} /src/deps/optional-lite/include"
26- PRIVATE "${CMAKE_BINARY_DIR} /src"
2726)
2827
2928target_link_libraries (_otio PUBLIC opentimelineio opentime )
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ include_directories(
33 ${PROJECT_SOURCE_DIR} /src/deps
44 ${PROJECT_SOURCE_DIR} /src/deps/optional-lite/include
55 ${PROJECT_SOURCE_DIR} /src/tests
6- ${CMAKE_BINARY_DIR} /src
76)
87
98list (APPEND tests_opentime test_opentime)
You can’t perform that action at this time.
0 commit comments