Skip to content

Commit

Permalink
OTIO working Swift import, align Imath dep.
Browse files Browse the repository at this point in the history
* Initial working OTIO swift import with cxx interop.
* Align all dependencies on Imath, remove Imath from OpenEXR.
* Fix headers pointing to OpenEXR/Imath to point to Imath.
  • Loading branch information
furby-tm committed Feb 14, 2024
1 parent d41f841 commit aabd3fe
Show file tree
Hide file tree
Showing 106 changed files with 136 additions and 41,628 deletions.
79 changes: 43 additions & 36 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,44 +338,38 @@ let package = Package(

.target(
name: "pystring",
publicHeadersPath: "include"
),

.target(
name: "ImathConfig",
publicHeadersPath: "include"
publicHeadersPath: "include",
cxxSettings: [
.headerSearchPath("include/pystring"),
]
),

.target(
name: "Imath",
dependencies: [
.target(name: "PyBind11"),
.target(name: "ImathConfig"),
.target(name: "pystring"),
Arch.OS.python(),
],
exclude: [
"src/ImathTest",
/* prefer pybindimath */
"src/python/PyImath",
"src/python/PyImathTest",
"website",
"src/python/PyImathNumpy",
"src/python/PyImathNumpyTest",
"src/python/PyImathPythonTest",
"src/python/PyImathSpeedTest",
"src/python/PyImathTest"
"src/python/PyImathTest",
"src/ImathTest",
"website",
],
publicHeadersPath: "src/Imath",
cxxSettings: [
.headerSearchPath("src/python/PyImath"),
]
),

.target(
name: "ImathHalf",
dependencies: [
.target(name: "Imath"),
],
publicHeadersPath: "include"
linkerSettings: [
.linkedFramework("OpenGL", .when(platforms: Arch.OS.apple.platform)),
]
),

.target(
Expand All @@ -394,7 +388,7 @@ let package = Package(
),

.target(
name: "OpenTimelineIO",
name: "OpenTime",
dependencies: [
.target(name: "PyBind11"),
.target(name: "any"),
Expand All @@ -403,21 +397,33 @@ let package = Package(
.target(name: "Imath"),
Arch.OS.python(),
],
path: "Sources/OpenTimelineIO/src/opentime",
publicHeadersPath: "include"
),

.target(
name: "OpenTimelineIO",
dependencies: [
.target(name: "OpenTime"),
],
path: "Sources/OpenTimelineIO/src/opentimelineio",
exclude: [
"tests",
"examples",
"src/deps",
"CORE_VERSION_MAP.last.cpp",
],
publicHeadersPath: "src"
publicHeadersPath: "include",
cxxSettings: [
.headerSearchPath("include/opentimelineio"),
]
),

.target(
name: "OpenEXR",
dependencies: [
.target(name: "Imath"),
.target(name: "DEFLATE", condition: .when(platforms: Arch.OS.apple.platform)),
],
publicHeadersPath: "include",
cSettings: [
cxxSettings: [
.headerSearchPath("."),
.headerSearchPath("OpenEXRCore"),
.headerSearchPath("include/OpenEXR"),
Expand Down Expand Up @@ -450,6 +456,7 @@ let package = Package(
.target(name: "Ptex"),
.target(name: "LibPNG"),
.target(name: "OpenVDB"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "PyBind11"),
],
Expand All @@ -475,6 +482,8 @@ let package = Package(
.target(
name: "OpenColorIO",
dependencies: [
.target(name: "pystring"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "MiniZip"),
.target(name: "Yaml"),
Expand All @@ -493,7 +502,7 @@ let package = Package(
.target(
name: "OCIOBundle",
dependencies: [
.target(name: "OpenColorIO")
.target(name: "OpenColorIO"),
],
resources: [
.copy("Resources/colormanagement"),
Expand All @@ -507,6 +516,7 @@ let package = Package(
name: "MetaPy",
dependencies: [
.target(name: "Boost"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "OpenVDB"),
.target(name: "Alembic"),
Expand Down Expand Up @@ -546,6 +556,7 @@ let package = Package(
dependencies: [
.target(name: "Boost"),
.target(name: "HDF5"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
Arch.OS.python(),
],
Expand Down Expand Up @@ -586,6 +597,7 @@ let package = Package(
.target(name: "MetaTBB"),
.target(name: "Blosc"),
.target(name: "PyBind11"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "ZLibDataCompression"),
Arch.OS.python(),
Expand All @@ -612,9 +624,10 @@ let package = Package(
name: "MetaversalDemo",
dependencies: [
.target(name: "ImGui"),
.target(name: "OpenColorIO"),
.target(name: "OCIOBundle"),
.target(name: "OpenColorIO"),
.target(name: "OpenImageIO"),
.target(name: "OpenTimelineIO"),
Arch.OS.python(),
],
swiftSettings: [
Expand Down Expand Up @@ -711,12 +724,8 @@ func getConfig(for target: PkgTarget) -> TargetInfo
break
case .pystring:
break
case .imathConfig:
break
case .imath:
break
case .imathHalf:
break
case .lzma2:
config.exclude = ["check/crc32_small.c"]
config.cSettings = [
Expand Down Expand Up @@ -1153,7 +1162,7 @@ func getConfig(for target: PkgTarget) -> TargetInfo
),
.library(
name: "OpenTimelineIO",
targets: ["any", "nonstd", "rapidjson", "OpenTimelineIO"]
targets: ["any", "nonstd", "rapidjson", "OpenTime", "OpenTimelineIO"]
),
.library(
name: "OpenEXR",
Expand All @@ -1177,7 +1186,7 @@ func getConfig(for target: PkgTarget) -> TargetInfo
),
.library(
name: "Imath",
targets: ["pystring", "ImathConfig", "Imath", "ImathHalf"]
targets: ["pystring", "Imath"]
),
.library(
name: "ImGui",
Expand Down Expand Up @@ -1526,11 +1535,9 @@ enum PkgTarget: String
case openmp = "OpenMP"
case glfw = "GLFW"
case imgui = "ImGui"
case sse2neon = "sse2neon"
case pystring = "pystring"
case sse2neon
case pystring
case imath = "Imath"
case imathConfig = "ImathConfig"
case imathHalf = "ImathHalf"
case mxGraphEditor = "MXGraphEditor"
case mxResources = "MXResources"
case materialx = "MaterialX"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Alembic/AbcCoreAbstract/TimeSampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include <Alembic/AbcCoreAbstract/DataType.h>

#include <OpenEXR/ImathMath.h>
#include <ImathMath.h>

#include <limits>

Expand Down
2 changes: 1 addition & 1 deletion Sources/Alembic/AbcCoreAbstract/TimeSamplingType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <Alembic/AbcCoreAbstract/TimeSamplingType.h>

#include <OpenEXR/ImathMath.h>
#include <ImathMath.h>

namespace Alembic {
namespace AbcCoreAbstract {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Alembic/AbcCoreOgawa/ReadUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# endif
#endif

#include <OpenEXR/half.h>
#include <half.h>

namespace Alembic {
namespace AbcCoreOgawa {
Expand Down
6 changes: 3 additions & 3 deletions Sources/Alembic/AbcGeom/XformSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include <Alembic/AbcGeom/XformSample.h>
#include <Alembic/AbcGeom/XformOp.h>

#include <OpenEXR/ImathMatrix.h>
#include <OpenEXR/ImathMatrixAlgo.h>
#include <OpenEXR/ImathQuat.h>
#include <ImathMatrix.h>
#include <ImathMatrixAlgo.h>
#include <ImathQuat.h>

#include <math.h>
#ifndef M_PI
Expand Down
10 changes: 5 additions & 5 deletions Sources/Alembic/include/Alembic/Abc/Foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
#include <Alembic/AbcCoreAbstract/All.h>
#include <Alembic/Util/All.h>

#include <OpenEXR/ImathVec.h>
#include <OpenEXR/ImathBox.h>
#include <OpenEXR/ImathMatrix.h>
#include <OpenEXR/ImathQuat.h>
#include <OpenEXR/ImathColor.h>
#include <ImathVec.h>
#include <ImathBox.h>
#include <ImathMatrix.h>
#include <ImathQuat.h>
#include <ImathColor.h>

#include <iostream>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Alembic/include/Alembic/AbcGeom/Foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include <Alembic/Abc/All.h>

#include <OpenEXR/ImathMatrixAlgo.h>
#include <OpenEXR/ImathEuler.h>
#include <ImathMatrixAlgo.h>
#include <ImathEuler.h>


namespace Alembic {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Alembic/include/Alembic/Util/Foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#include <memory>

#include <OpenEXR/half.h>
#include <half.h>

#include <iomanip>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Imath
1 change: 0 additions & 1 deletion Sources/ImathConfig/ImathConfig.cpp

This file was deleted.

Loading

0 comments on commit aabd3fe

Please sign in to comment.