Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在Eclipse中配置CMake?_C++_Eclipse_Cmake_Vcpkg - Fatal编程技术网

C++ 如何在Eclipse中配置CMake?

C++ 如何在Eclipse中配置CMake?,c++,eclipse,cmake,vcpkg,C++,Eclipse,Cmake,Vcpkg,我有一个shell脚本,可以在Ubuntu 18.04上构建一个有效的项目。我还想从Eclipse构建项目,以便我有更好的代码导航和调试。当我构建项目时,我得到了错误 CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Modules directory not found in /usr/share/cmake-3.16 CMake Erro

我有一个shell脚本,可以在Ubuntu 18.04上构建一个有效的项目。我还想从Eclipse构建项目,以便我有更好的代码导航和调试。当我构建项目时,我得到了错误

CMake Error: Could not find CMAKE_ROOT !!!  
CMake has most likely not been installed correctly.  
Modules directory not found in  
/usr/share/cmake-3.16  
CMake Error: Error executing cmake::LoadCache(). Aborting.
我已经在/opt/CMake/share/CMake-3.16/上安装了CMake,并且还安装在vcpkg的下面。我的shell脚本和我的首选是使用vcpkg下的版本(3.14)。CMAKE_根似乎是由脚本生成的

../../../vcpkg_pml/vcpkg/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-Linux-x86_64/bin/cmake -G Ninja -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=../../../vcpkg_pml/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=./../../vcpkg_pml/vcpkg/installed/x64-linux/share/doctest -DBOOST_ROOT=/opt/boost_1_72_0 -DCMAKE_BUILD_TYPE=Debug -S ../
在Eclipse(2019-12,4.14.0)中,我尝试在属性| C/C++构建| Cmake4eclipse |符号选项卡和属性| C/C++构建|环境中定义CMAKE|U根

该日志显示了对/opt/cmake/share/cmake-3.16下的文件和vcpkg(3.14)下深层文件的混合引用

如何控制从Eclipse运行哪个版本的cmake


该项目也在Windows上的Visual Studio中构建和测试。

可能是一个愚蠢的问题,但您是否尝试过更改以下项下的值集:Properties | C/C++Build | Cmake4eclipse | Host OS overrides | Linux | Cmake Executable?是的,在发布问题之后。它生成:错误:在路径中找不到程序“~/develop/source/vcpkg\u pml/vcpkg/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-linux-x86\u 64/bin/cmake”。我没想到它会在路径上。工具链编辑器中有冲突。我将使用的工具简化为CMake驱动的语言代理。现在它挂起doing/usr/bin/make-j 2147483647 clean。