File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Features
2222- CMake:
2323
2424 - build a shared library by default #506
25- - generate pkg-config ``.pc `` file #532
25+ - generate pkg-config ``.pc `` file #532 #535
2626- Python:
2727
2828 - manylinux2010 wheels for PyPI #523
Original file line number Diff line number Diff line change @@ -731,8 +731,25 @@ configure_file(
731731 ${openPMD_BINARY_DIR} /openPMDConfig.cmake
732732 @ONLY
733733)
734+
735+ # get absolute paths to linked libraries
736+ function (openpmdreclibs tgtname outname)
737+ get_target_property (PC_PRIVATE_LIBS_TGT ${tgtname} INTERFACE_LINK_LIBRARIES)
738+ foreach (PC_LIB IN LISTS PC_PRIVATE_LIBS_TGT)
739+ if (TARGET ${PC_LIB} )
740+ openpmdreclibs(${PC_LIB} ${outname} )
741+ else ()
742+ if (PC_LIB)
743+ string (APPEND ${outname} " ${PC_LIB} " )
744+ endif ()
745+ endif ()
746+ endforeach ()
747+ set (${outname} ${${outname} } PARENT_SCOPE)
748+ endfunction ()
749+
734750if (openPMD_HAVE_PKGCONFIG)
735- CONFIGURE_FILE (
751+ openpmdreclibs(openPMD openPMD_PC_PRIVATE_LIBS)
752+ configure_file (
736753 ${openPMD_SOURCE_DIR} /openPMD.pc.in
737754 ${openPMD_BINARY_DIR} /openPMD.pc
738755 @ONLY
Original file line number Diff line number Diff line change 1+
12C++ & Python API for Scientific I/O with openPMD
23================================================
34
@@ -289,6 +290,10 @@ Additional linker and compiler flags for your project are available via:
289290pkg-config --libs openPMD
290291# -L${HOME}/somepath/lib -lopenPMD
291292
293+ # if you build openPMD-api as static library with `-DBUILD_SHARED_LIBS=OFF`
294+ pkg-config --libs --static openPMD
295+ # -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lopenPMD -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so /usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so
296+
292297pkg-config --cflags openPMD
293298# -I${HOME}/somepath/include
294299```
You can’t perform that action at this time.
0 commit comments