[CMake] Macro/function called that depends on the parameter of a macro

Alexander Neundorf a.neundorf-work at gmx.net
Tue May 12 14:39:24 EDT 2009


On Tuesday 12 May 2009, Olivier Delannoy wrote:
> Hi,
> I am trying to integrate third party library without doing recursive
> project and the add_subdirecty command. I would like to know what is
> the syntax that could allow something similar to:
> where IMPORT_LIBRARY_${_LIB}_USED_BY is defined when including the
> import library definition in the current project.
>
> macro(target_use_import_library _LIB _TARGET)
> # more bookeeping here
> IMPORT_LIBRARY_${_LIB}_USED_BY(${_TARGET})
> # more bookeeping here
> endmacro(target_use_import_library)
>
> Cmake include failed reporting an error about command name expected.

Yes, constructing names of macros/functions is not supported.
You'll have to find a different way to do it.
Maybe you could construct the name of a file which is included ?

Alex


More information about the CMake mailing list