Don't use macros in template-config.cmake
j-o opened this issue · 1 comments
j-o commented
Using macros in config scripts is problematic because macros in cmake don't get their own variable scope:
Note that if you have a variable with the same name in the scope from which the macro is called, using unreferenced names will use the existing variable instead of the arguments.
(http://www.cmake.org/cmake/help/v3.0/command/macro.html)
Now, if a project just so happens to use LIBNAME
instead of target
to define a target name and includes a cmake-init based library, the library's config-script will silently change the target name (!).
scheibel commented
With cmake-init 2.0 we use built-in functionality of CMake so this shouldn't bother us anymore.