我正在努力学习dds。根据教程,附录1建议查看github中提供的名为dds-examples-cpp-ex的示例。
根据自述文件构建此示例的简单命令是cmake . && make
我执行命令
cmake . && make
在我的本地机器上克隆后,从该文件夹的cmake目录
我得到以下错误:
CMake Error at CMakeLists.txt:28 (FIND_PACKAGE):
By not providing "FindOpenSplice.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"OpenSplice", but CMake did not find one.
Could not find a package configuration file provided by "OpenSplice" with
any of the following names:
OpenSpliceConfig.cmake
opensplice-config.cmake
Add the installation prefix of "OpenSplice" to CMAKE_PREFIX_PATH or set
"OpenSplice_DIR" to a directory containing one of the above files. If
"OpenSplice" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "/home/gajendra/Documents/AnokhiDocs/DDS/dds-tutorial-cpp-ex/cmake/CMakeFiles/CMakeOutput.log".
我试图找到OpenSpliceConfig.cmake
&;opensplice-config.cmake
在我的系统上,但我没有得到任何结果。
我的问题是如何更正路径或修复此错误?
我在本地机器上运行了OpenSplice,并直接从$OSPL_HOME/opensplice/dcps/Tutorial
执行了其他示例。它们工作得很好。
我还尝试构建ch1
。我从编辑了ch1/CMakeLists.txt
中的第二行
set(CMAKE_MODULE_PATH ../cmake)
至
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
以便能够在CCD_ 7所在的根目录中找到cmake文件夹。
当我执行以下操作时,我遇到了同样的问题:
cd ch1 && mkdir build && cd build && cmake ..
CMake Error at /home/gajendra/Documents/AnokhiDocs/DDS/dds-tutorial-cpp-ex/cmake/FindOpenSplice.cmake:72 (MESSAGE):Could not find OpenSplice DDS
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)
我在Ubuntu 20.04和OpenSplice 6.10.3p1 上遇到了同样的问题
我只是在安装目录中找到了release.com文件,然后转到每个";ch";按照@Tsyvarev建议的文件夹,并从那里运行cmake . && make
。
CMake随后成功运行。