On 1 June 2012 17:22, David Cole <david.c...@kitware.com> wrote:

> Not directly, but as a workaround, you could write that into a file, and
> then include the file.
>
> i.e.:
>
> file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/tmp.cmake" "BAR_${FOO}(arg1 arg2)")
> include(${CMAKE_CURRENT_BINARY_DIR}/tmp.cmake)
>

Hi, there is also a variation based on the workaround given by David:

suppose you want to call:
bar_${foo1}(arg1 arg2)
bar_${foo2}(arg1 arg2)

you can create 2 files:
- bar1.cmake
macro(bar)
...
endmacro()

- bar2.cmake
macro(bar)
...
endmacro()

After that you can replace:
bar_${foo1}(arg1 arg2)
bar_${foo2}(arg1 arg2)
by:
include(${foo1}.cmake)
bar(...)
include(${foo2}.cmake)
bar(...)

where:
${foo1} = bar1
${foo2} = bar2

Regards,
Damien R.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to