[CMake] Scoping of CMake functions included from modules

Timothy Wrona tjwrona1992 at gmail.com
Tue Mar 10 18:00:45 EDT 2020


I've been working on a relatively complicated project that uses multiple
CMake modules. Some of these modules internally include other modules. The
issue is, when one of my modules internally includes another module, all of
the functions from the internal module become visible globally throughout
my whole project!

I have written a Stack Overflow problem with a basic example demonstrating
my problem:
https://stackoverflow.com/questions/60626239/how-can-i-scope-a-cmake-function-so-it-cant-be-accessed-from-outside-a-file


Unfortunately CMake doesn't get much response on Stack Overflow so I
figured I should probably send a message to the mailing list as well.

Does anyone know how to resolve this problem?

Thanks,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20200310/180045bc/attachment.html>


More information about the CMake mailing list