【CMAKE】求助-cmake 请问谁知道CMAKE如何使用?真正的初学者,win7系统,使用VS2005
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了【CMAKE】求助-cmake 请问谁知道CMAKE如何使用?真正的初学者,win7系统,使用VS2005相关的知识,希望对你有一定的参考价值。
问题来源于一个文档,
1,准备工作:首先,在/backup 目录建立一个 cmake 目录,用来放置我们学习过程中的所有练习。mkdir -p /backup/cmake以后我们所有的 cmake 练习都会放在/backup/cmake 的子目录下(你也可以自行安排目录,这个并不是限制,仅仅是为了叙述的方便)然后在 cmake 建立第一个练习目录 t1cd /backup/cmakemkdir t1cd t1在 t1 目录建立 main.c 和 CMakeLists.txt(注意文件名大小写):main.c 文件内容://main.c#include <stdio.h>int main() printf(“Hello World from t1 Main!\n”); return 0;CmakeLists.txt 文件内容:PROJECT (HELLO)SET(SRC_LIST main.c)MESSAGE(STATUS "This is BINARY dir " $HELLO_BINARY_DIR)MESSAGE(STATUS "This is SOURCE dir "$HELLO_SOURCE_DIR)ADD_EXECUTABLE(hello SRC_LIST)2,开始构建所有的文件创建完成后,t1 目录中应该存在 main.c 和 CMakeLists.txt
两个文件接下来我们来构建这个工程,在这个目录运行:cmake . (注意命令后面的点号,代表本目录)。输出大概是这个样子:-- Check for working C compiler: /usr/bin/gcc-- Check for working C compiler: /usr/bin/gcc -- works-- Check size of void*-- Check size of void* - done
……
请问 那个“在这个目录运行:cmake . (注意命令后面的点号,代表本目录)。”如何在这个目录运行的啊?
我查了 bash 和 mingw,感觉很复杂,但说明书上好像显得没那么复杂啊……(我是用的是win7系统),难道是cmd中?
追答cmd也可以的 但是你安装cmake时要把cmake路径加到path中
追问阁下可以描述下 如何 把cmake路径加到path中吗?
MAC: CMake compile CloudCompare error:By not providing "FindQt5PrintSupport.cmake" in CMAK
ERROR message as:
CMake Warning at CC/CMakeLists.txt:26 (message): CCLib configured without parallel algorithm capabilities - see COMPILE_CC_CORE_LIB_WITH_TBB CMake Error at cmake/CMakeExternalLibs.cmake:18 (find_package): By not providing "FindQt5PrintSupport.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5PrintSupport", but CMake did not find one. Could not find a package configuration file provided by "Qt5PrintSupport" with any of the following names: Qt5PrintSupportConfig.cmake qt5printsupport-config.cmake Add the installation prefix of "Qt5PrintSupport" to CMAKE_PREFIX_PATH or set "Qt5PrintSupport_DIR" to a directory containing one of the above files. If "Qt5PrintSupport" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CC/CMakeLists.txt:32 (include) -- Configuring incomplete, errors occurred! See also "/Users/mac/liuxueli/CloudCompare-master/build/CMakeFiles/CMakeOutput.log". ShirleydeMacBook-Pro:build mac$ vim ../cmake/CMakeExternalLibs.cmake ShirleydeMacBook-Pro:build mac$ cmake .. cmake policies active: cmake policies active: CMake Warning at CC/CMakeLists.txt:26 (message): CCLib configured without parallel algorithm capabilities - see COMPILE_CC_CORE_LIB_WITH_TBB CMake Error at cmake/CMakeExternalLibs.cmake:19 (find_package): By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Concurrent", but CMake did not find one. Could not find a package configuration file provided by "Qt5Concurrent" with any of the following names: Qt5ConcurrentConfig.cmake qt5concurrent-config.cmake Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set "Qt5Concurrent_DIR" to a directory containing one of the above files. If "Qt5Concurrent" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CC/CMakeLists.txt:32 (include) -- Configuring incomplete, errors occurred! See also "/Users/mac/liuxueli/CloudCompare-
解决方案:
修改cmake/CMakeExternalLibs.cmake文件,添加一行内容:
set (CMAKE_PREFIX_PATH "/usr/local/Cellar/qt/5.10.1/lib/cmake")
/usr/local/Cellar/qt/5.10.1/lib/cmake 为对应的QT安装路径
修改后重新cmake .. 即可成功。