File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,17 @@ if (PUGIXML_USE_POSTFIX)
192192 endif ()
193193endif ()
194194
195+ # Handle both relative and absolute paths (e.g. NixOS) for a relocatable package
196+ if (IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR} " )
197+ set (PUGIXML_PC_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR} " )
198+ else ()
199+ set (PUGIXML_PC_INCLUDEDIR "\$ {prefix}/${CMAKE_INSTALL_INCLUDEDIR} " )
200+ endif ()
201+ if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR} " )
202+ set (PUGIXML_PC_LIBDIR "${CMAKE_INSTALL_LIBDIR} " )
203+ else ()
204+ set (PUGIXML_PC_LIBDIR "\$ {exec_prefix}/${CMAKE_INSTALL_LIBDIR} " )
205+ endif ()
195206configure_file (scripts/pugixml.pc.in pugixml.pc @ONLY)
196207
197208export (TARGETS ${install -targets}
Original file line number Diff line number Diff line change 11prefix=@CMAKE_INSTALL_PREFIX@
22exec_prefix=${prefix}
3- includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@@INSTALL_SUFFIX @
4- libdir=@CMAKE_INSTALL_FULL_LIBDIR@@INSTALL_SUFFIX @
3+ includedir=@PUGIXML_PC_INCLUDEDIR @
4+ libdir=@PUGIXML_PC_LIBDIR @
55
66Name: pugixml
77Description: Light-weight, simple and fast XML parser for C++ with XPath support.
You can’t perform that action at this time.
0 commit comments