openvdb icon indicating copy to clipboard operation
openvdb copied to clipboard

[BUILD] flags from the png pkg-config ignored for vdb_tool

Open darix opened this issue 1 year ago • 0 comments

pkg-config --cflags /usr/lib64/pkgconfig/libpng16.pc
-I/usr/include/libpng16

a patch like this would fix it. Edit: patch updated as --libs from the pkg-config is also ignored.

Index: openvdb-12.0.0/openvdb_cmd/vdb_tool/CMakeLists.txt
===================================================================
--- openvdb-12.0.0.orig/openvdb_cmd/vdb_tool/CMakeLists.txt
+++ openvdb-12.0.0/openvdb_cmd/vdb_tool/CMakeLists.txt
@@ -80,10 +80,12 @@ if(OPENVDB_TOOL_USE_PNG)
   target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_PNG")
   if(WIN32)
     find_package(libpng CONFIG REQUIRED)
+    target_link_libraries(vdb_tool_common INTERFACE png)
   else()
     find_package(PNG REQUIRED)
+    target_include_directories(vdb_tool_common INTERFACE ${PNG_INCLUDE_DIR})
+    target_link_libraries(vdb_tool_common INTERFACE ${PNG_LIBRARIES})
   endif()
-  target_link_libraries(vdb_tool_common INTERFACE png)
 endif()
 
 if(OPENVDB_TOOL_USE_PDAL)

darix avatar Nov 14 '24 00:11 darix