Generate a PollyConfig.cmake for use with Cmake's find_package in out-of-tree projects.
This patch is based on Meinersbur's template, including some fixes and most importantly the appropriate ISL target.
Differential D30495
[Polly][Cmake] Generate a PollyConfig.cmake philip.pfaffe on Mar 1 2017, 4:03 AM. Authored by
Details Generate a PollyConfig.cmake for use with Cmake's find_package in out-of-tree projects. This patch is based on Meinersbur's template, including some fixes and most importantly the appropriate ISL target.
Diff Detail
Event TimelineComment Actions Thank you for picking up and continue my PollyConfig patch. I stopped when I discovered that I could generate the IMPORTED libraries using the [[ https://cmake.org/cmake/help/v3.7/command/export.html | export ]] command and couldn't decide whether it was better. You seem to have decided against using it. Can you share why?
Comment Actions I didn't go with export() because it solves only half the problem. The exported targets are only valid for the build tree. The equivalent for the install tree would be install(EXPORT) together with the appropriate per-target install options. I don't think the second path is feasible for Polly, because it requires invasive changes to LLVM's cmake setup. Thus, I'd have to manually export the targets for the install tree anyways. I still could've used export() for the build tree, but I prefer the symmetry of my solution. Updates wrt. to the inline comments coming soon. Comment Actions Addressed inline comments and a couple of extra issues I found, specifically the missing IMPORTED_LOCATION settings. Comment Actions Thanks for this update. Here are some more comments.
Comment Actions Addressed inline comments. This patch now generates one Exports file per Configuration and should now also work on Windows. Comment Actions Thanks for making it work under Windows. Could you just remove the debugging line if it is one (or let me do it), then I'll commit.
|