Issue
I found many project with CMake building system will create some_independent_function.CMake.
For example, folly and other Facebook library. They use variable like FOLLY_INCLUDE with CMake recommended naming rules to mark input and output for function to find folly project. Obviously it uses implicit variable as output.
How could I get some structured information for in and out, like
A_Standard_Package_Info_Object, err = package.find_package(Findfolly.cmake)
I want some closure feature with CMake. How could I set parameters as input and use return as output? Or could I encapsulate some function into a package rather than use scripts file with implicit variables?
Solution
That is not how the CMake language works. It is not designed to have such returns. Implicit variable names is the way to go.
Feel free to dislike for this design choices, then you are in good company :-)
Answered By - usr1234567