CMake
===========================================================
- CMake Reference Documentation — CMake 3.16.4 Documentation
- Cmake 如何入门? - 0xCCCCCCCC的回答 - 知乎 https://www.zhihu.com/question/58949190/answer/999701073
启动cmake构建命令行示例:
cmake -G "Visual Studio 16 2019" -A x64 -D CMAKE_INSTALL_PREFIX=C:WORKSPACEOPENCLsamplesuild C:WORKSPACEOPENCLsamples
使用cmake
===========================================================
了解cmake加入第三方库的机制
CMake之find_package - 简书
//可以通过set()设置<包名>_DIR这样的值,来设置find_package的默认查找目录
常识使用cmake构建sln项目;
已安装VS2019;
安装CMake;
写源代码;
在项目文件夹创建CmakeLists.txt;其中指定了项目名称,包含的文件;
在当前文件夹执行cmake .;进行内构建;
没有进行任何设置,其自动检测到了VS2019的环境并展开成一个sln项目;
PS C:WORKSPACECMAKEcmake_tutorial> cmake -S . -B .uild # 可以用-S和-B指定Source和Build的路径;
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/WORKSPACE/CMAKE/cmake_tutorial/build
PS C:WORKSPACECMAKEcmake_tutorial>
打开生成的sln项目,一般都具有多个“启动项目”,如ALL_BUILD,ZERO_CHECK等;
运行
若运行时出现“ 无法启动程序 xxxALL_BUILD 系统找不到指定文件”,则在解决方案资源管理器中,右击源代码对应的项目,设为启动项目;
VS2010 配置PCL1.6.0AII in one 无法启动程序ALL_BUILD - 止战 - 博客园
Cmake以及在软件工程中的一系列构建项目流程
===========================================================
- LInux ./configure、make、make install 命令_Q563573095的博客-CSDN博客
- ./configure
- cmake
- make
- make install
config