Closed SalvoVirga closed 4 years ago
Please look at the Developer's Guide section on code generation in C++11 mode.
I did, on page 132 it only says running “opendds_idl -Lc++11"
. Which to my understanding is what OPENDDS_IDL_OPTIONS -Lc++11
should allow to do. I cannot find any more info regarding this.
There are more changes than just -Lc++11
Unlike when using the classic mapping, Foo.idl is not processed by tao_idl.
I suggest starting from a working example project (generated by MPC) and then change CMake to do the same thing.
I think this is enough to get this working:
diff --git a/cmake/dds_idl_sources.cmake b/cmake/dds_idl_sources.cmake
index 7c4c6f51f..8f5373f5d 100644
--- a/cmake/dds_idl_sources.cmake
+++ b/cmake/dds_idl_sources.cmake
@@ -135,8 +135,9 @@ function(opendds_target_idl_sources target)
unset(_ddsidl_cmd_arg_-GfaceTS)
unset(_ddsidl_cmd_arg_-o)
unset(_ddsidl_cmd_arg_-Wb,java)
+ unset(_ddsidl_cmd_arg_-Lc++11)
- cmake_parse_arguments(_ddsidl_cmd_arg "-SI;-GfaceTS;-Wb,java" "-o" "" ${_ddsidl_flags})
+ cmake_parse_arguments(_ddsidl_cmd_arg "-SI;-GfaceTS;-Wb,java;-Lc++11" "-o" "" ${_ddsidl_flags})
get_filename_component(noext_name ${input} NAME_WE)
get_filename_component(abs_filename ${input} ABSOLUTE)
@@ -162,6 +163,8 @@ function(opendds_target_idl_sources target)
list(APPEND _cur_idl_headers ${output_prefix}C.h ${output_prefix}_TS.hpp)
list(APPEND _cur_idl_cpp_files ${output_prefix}_TS.cpp)
## if this is FACE IDL, do not reprocess the original idl file throught tao_idl
+ elseif (_ddsidl_cmd_arg_-Lc++11)
+ list(APPEND _cur_idl_headers "${output_prefix}C.h")
else()
set(_cur_idl_file ${input})
endif()
It compiles the given example. I think it just needs its own test and maybe a way to signal which mapping is being used (for https://github.com/oci-labs/pyopendds/issues/9).
I am trying to generate messages with C++11 mapping over CMake and I have the following tiny example:
demo.idl
CMakeLists.txt
But when running
cmake
andmake
I get the following error:Am I missing something in the CMake call to
OPENDDS_TARGET_SOURCES
? Thanks in advance for any help!