ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

A solution that doesn't involve build artifacts in the source tree could be to turn the generated files into a library or add it to the executable- convert the binary files into header files like http://stackoverflow.com/questions/8707183/script-tool-to-convert-file-to-c-c-source-code-array

xxd -i my_cmake_generated_file.bin > my_cmake_generated_file.h

A solution that doesn't involve build artifacts in the source tree could be to turn the generated files into a library or add it to the executable- convert the binary files into header files like http://stackoverflow.com/questions/8707183/script-tool-to-convert-file-to-c-c-source-code-array

xxd -i my_cmake_generated_file.bin > my_cmake_generated_file.h

Which produces:

``` unsigned char my_cmake_generated_file[] = { 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x44, 0x00, ... 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00 }; unsigned int my_cmake_generated_file_len = 83;

```

A solution that doesn't involve build artifacts in the source tree could be to turn the generated files into a library or add it to the executable- convert the binary files into header files like http://stackoverflow.com/questions/8707183/script-tool-to-convert-file-to-c-c-source-code-array

 xxd -i my_cmake_generated_file.bin > my_cmake_generated_file.h

Which produces:

```

unsigned char my_cmake_generated_file[] = {
 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x44, 0x00,
...
  0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00
};
unsigned int my_cmake_generated_file_len = 83;

83;

```

A solution that doesn't involve build artifacts in the source tree could be to turn the generated files into a library or add it to the executable- convert the binary files into header files like http://stackoverflow.com/questions/8707183/script-tool-to-convert-file-to-c-c-source-code-array

xxd -i my_cmake_generated_file.bin > my_cmake_generated_file.h

Which produces:

unsigned char my_cmake_generated_file[] = {
0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x44, 0x00,
...
  0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00
};
unsigned int my_cmake_generated_file_len = 83;

And then code that loads a binary into a byte array could be simplified to just use this from the header file directly