How to import from build tree? (Answered)

Hello there,

It took me more time than expected to find out how to “import” an export file that I created with the export from a build tree approach. That is using the export() command.

I learned how to export from a build tree from following links:

https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Exporting-and-Importing-Targets

https://cmake.org/cmake/help/latest/command/export.html

So the answer is: you import such files using the include() command.

Maybe this information can be added to the above links ?

Thanks in advance or a great tool…

See the cmake-packages(7) manual.