When attempting to link gprt to xdg in the CMakeLists.txt, I was encountering a CMake error to do with GPRT not exporting install targets:
CMake Error: install(EXPORT "xdg-targets" ...) includes target "xdg" which requires target "gprt" that is not in any export set.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
This error would be thrown but CMake would still generate the Makefile and XDG could be compiled as normal with tests passing and installation still seemingly working.
As a work around for this CMake error I have changed the following line in the CMakeLists.txt:
target_link_libraries(xdg gprt)
to:
target_link_libraries(xdg $<BUILD_INTERFACE:gprt>)
This ensures linking only happens at build time and not installation time. This is more of a workaround than a real fix and I am unsure if we will need GPRT to be linked at installation time as well as build time.
Originally posted by @Waqar-ukaea in https://github.com/pshriwise/xdg/issues/94#issuecomment-2796476896
When attempting to link gprt to xdg in the CMakeLists.txt, I was encountering a CMake error to do with GPRT not exporting install targets:
This error would be thrown but CMake would still generate the Makefile and XDG could be compiled as normal with tests passing and installation still seemingly working.
As a work around for this CMake error I have changed the following line in the CMakeLists.txt:
target_link_libraries(xdg gprt)to:
target_link_libraries(xdg $<BUILD_INTERFACE:gprt>)This ensures linking only happens at build time and not installation time. This is more of a workaround than a real fix and I am unsure if we will need GPRT to be linked at installation time as well as build time.
Originally posted by @Waqar-ukaea in https://github.com/pshriwise/xdg/issues/94#issuecomment-2796476896