I have the following macro for generation of c++ source from a proprietary IDL language:<br><br>macro (oidl_generate IDL_SOURCES IDL_INCLUDE_DIRS)<br> message (STATUS "IDL Sources: ${IDL_SOURCES}")<br> foreach (idlsrc ${IDL_SOURCES})<br>
get_filename_component (idlsrc_file ${idlsrc} NAME_WE)<br> get_filename_component (idlsrc_path ${idlsrc} PATH)<br> set (outsrc_file ${CMAKE_CURRENT_BINARY_DIR}/${idlsrc_path}/${idlsrc_file}.cpp)<br> set (outsrc_path ${CMAKE_CURRENT_BINARY_DIR}/${idlsrc_path})<br>
set (omegaprotocols_SOURCES ${omegaprotocols_SOURCES} ${outsrc_file})<br> set_source_files_properties ($outsrc_file PROPERTIES OBJECT_DEPENDS ${idlsrc})<br> set (insrc_file ${CMAKE_CURRENT_SOURCE_DIR}/${idlsrc})<br>
make_directory (${outsrc_path})<br> add_custom_command (<br> OUTPUT ${outsrc_file}<br> DEPENDS oidl<br> COMMAND oidl ${insrc_file} -m -dynamic -O ${outsrc_path} ${IDL_INCLUDE_DIRS}<br> )<br> endforeach ()<br>
endmacro ()<br><br>I call the macro from another CMakeLists.txt file:<br><br>include (OidlRules)<br>message (STATUS "IDL Sources from protocols: ${omegaprotocols_IDL_SOURCES}")<br>oidl_generate (${omegaprotocols_IDL_SOURCES} ${omegaprotocols_IDL_INCLUDES})<br>
<br>Inside of my macro, the status message indicates that ${IDL_SOURCES} is not getting expanded to the full list, but is instead giving me the first element of the list I passed in. In my CMakeLists.txt file, before I call the macro, status message indicates that the ${omegaprotocols_IDL_SOURCES} value is the expected full list. Is anything special required when passing lists as arguments to macros?<br>
<br>Many thanks,<br>-allen<br><br>