2

I have installed the latest version of OpenDDS I followed the configuration and installation documents provided.

I can perfectly run opendds examples with the terminal. I need to integrate OpenDDS with QT, since OpenDDS supports CMake

I have tried to load CMakeList.txt in qt for messenger_1 and messeger_2 examples I got, unknown CMake command "OPENDDS_TARGET_SOURCE"

I wasn't able to run the IShape example either.

Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
user9995
  • 21
  • 1

1 Answers1

2

This most probably means that CMake does not find the OpenDDS package files.

CMake reads the CMake variable CMAKE_PREFIX_PATH and extends its default package search path by this. By default Qt Creator sets that to your Qt install path (which is good since you want to use Qt), but to use OpenDDS you need to point it to its source/install path as well (see the OpenDDS CMake documentation).

You can add multiple paths to CMAKE_PREFIX_PATH, separated by ; on Windows, or : on Linux/macOS.

In Qt Creator the CMAKE_PREFIX_PATH is set up in the CMake Configuration part of the Kit. So:

  • Open "Options > Kits > Kits" and choose the kit you use for your project
  • Scroll down to CMake Configuration and click Change
  • Find the CMAKE_PREFIX_PATH line and change it to something like
    CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\path\to\OpenDDS or if you are on Linux/macOS
    CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/path/to/OpenDDS

You might need to close and re-open the project after that (but maybe not).

E4z9
  • 1,713
  • 9
  • 11