I am using the build directory’s ...Config.cmake file to test that the project works well with find_package. However, on windows this approach does not seem to work, giving me DLL_IMPORT errors. I am not sure what to make of this. Looking at the generated file it looks like:
Not sure how the install one is supposed to look like and what is responsible for populating Path in order for a test executable to be runable from there.
Most of the contents I am already implementing. Currently working on this if more context is helpful
The issue here is more along the line of how export(EXPORT) creates the targets for build so that an executable can be run. Alex’s SO approach with TARGET_RUNTIME_DLL_DIRS is indeed very, although it is cumbersome to implement
Thanks Ben, indeed I have converged to a similar approach. It would be nice if export(EXPORT) were able to take care of that similar to RPATH, like populating ENVIRONMENT_MODIFICATIONS , but there is no mechanism for propagating properties like INTERFACE, so indeed I can’t see a way around it.