Skip to content

Commit 97ecf13

Browse files
Fixes for C++ examples (#1967)
* Fix include directories * Change conditional for VS * Enable examples in CI * Fix warning about ignored return variable Signed-off-by: Darby Johnston <[email protected]>
1 parent 30f6f56 commit 97ecf13

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: |
5656
cmake -E make_directory ${{ env.OTIO_BUILD_DIR }}
5757
cd ${{ env.OTIO_BUILD_DIR }}
58-
cmake ${{ github.workspace }} -DCMAKE_INSTALL_PREFIX=${{ env.OTIO_INSTALL_DIR }} -DOTIO_SHARED_LIBS=OFF -DOTIO_CXX_COVERAGE=ON
58+
cmake ${{ github.workspace }} -DCMAKE_INSTALL_PREFIX=${{ env.OTIO_INSTALL_DIR }} -DOTIO_SHARED_LIBS=OFF -DOTIO_CXX_COVERAGE=ON -DOTIO_CXX_EXAMPLES=ON
5959
cmake --build . --config ${{ env.OTIO_BUILD_CONFIG }}
6060
- name: Run tests
6161
run: |

examples/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
find_package(PythonLibs REQUIRED)
22

33
include_directories(${PROJECT_SOURCE_DIR}/src
4-
${PROJECT_SOURCE_DIR}/src/deps
5-
${PROJECT_SOURCE_DIR}/src/deps/optional-lite/include
4+
${CMAKE_CURRENT_BINARY_DIR}/../src
65
${PYTHON_INCLUDE_DIRS})
76

87
list(APPEND examples conform)

examples/flatten_video_tracks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
3838
// into a single track.
3939
std::cout << "Flattening " << video_tracks.size() << " video tracks into one..." << std::endl;
4040
auto onetrack = otio::flatten_stack(video_tracks, &error_status);
41-
if (!onetrack or is_error(error_status))
41+
if (!onetrack || is_error(error_status))
4242
{
4343
examples::print_error(error_status);
4444
return 1;

examples/util.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ std::string normalize_path(std::string const& in)
132132
std::string absolute(std::string const& in)
133133
{
134134
char buf[PATH_MAX];
135-
realpath(in.c_str(), buf);
135+
if (NULL == realpath(in.c_str(), buf))
136+
{
137+
buf[0] = 0;
138+
}
136139
return buf;
137140
}
138141

0 commit comments

Comments
 (0)