Skip to content

Commit a9c5992

Browse files
committed
updated the cmake and documentation
1 parent fe3ed3a commit a9c5992

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

docs/examples/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ find_package(pythonic REQUIRED)
2525
# The viewer also depends on GLFW at link/config time; projects that
2626
# link `pythonic::pythonic_graph_viewer` may want to ensure GLFW is
2727
# available. Find it here to provide clearer error messages early.
28-
find_package(GLFW REQUIRED)
28+
find_package(glfw3 REQUIRED)
29+
30+
# Find ImageMagick for image rendering support
31+
find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
32+
33+
# Find FFmpeg for video rendering support
34+
find_package(PkgConfig REQUIRED)
35+
pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libswscale libavutil)
2936

3037
# Add your executable
3138
# --> Replace 'demoapp' with your project executable name
@@ -38,7 +45,10 @@ add_executable(demoapp demo.cpp)
3845

3946
# Link libraries to your target
4047
# --> Add other libraries here if your project depends on them
41-
target_link_libraries(demoapp PRIVATE pythonic::pythonic)
48+
target_link_libraries(demoapp PRIVATE pythonic::pythonic ImageMagick::Magick++ ${FFMPEG_LIBRARIES})
49+
50+
# Add FFmpeg include directories
51+
target_include_directories(demoapp PRIVATE ${FFMPEG_INCLUDE_DIRS})
4252

4353
# If you installed Pythonic with the optional Graph Viewer enabled
4454
# (build/install Pythonic with `-DPYTHONIC_ENABLE_GRAPH_VIEWER=ON`),

docs/examples/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,19 @@ find_package(OpenGL REQUIRED)
296296
# Find the Pythonic library
297297
find_package(pythonic REQUIRED)
298298
299+
# Find ImageMagick and FFmpeg for media rendering support (images and videos)
300+
find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
301+
find_package(PkgConfig REQUIRED)
302+
pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libswscale libavutil)
303+
299304
# Add your executable (replace main.cpp with your source files)
300305
add_executable(myapp main.cpp)
301306
302-
# Link the Pythonic library
303-
target_link_libraries(myapp PRIVATE pythonic::pythonic)
307+
# Link the Pythonic library and media dependencies
308+
target_link_libraries(myapp PRIVATE pythonic::pythonic ImageMagick::Magick++ ${FFMPEG_LIBRARIES})
309+
310+
# Add FFmpeg include directories
311+
target_include_directories(myapp PRIVATE ${FFMPEG_INCLUDE_DIRS})
304312
305313
# If you built and installed Pythonic with the Graph Viewer enabled,
306314
# link the viewer target to enable `var::show()` in your app:

0 commit comments

Comments
 (0)