查看cmake变量
查看系统环境变量
检查是否是win32系统
检查是否是Linux系统
检查环境变量是否设置
表</span>
检查表中是否包含某值
变量
出错信息
逻辑运算符</span>
AND
OR
NOT
Compound
指定查找.cmake文件位置
检查是否找到软件包
抑制警告
取消版本警告</span>
查找目录中的CMakeList.txt</span>
或者
如果环境变量包含了OPENSSL_LIB_PATH,直接使用
如果没有设置环境变量,通过cmake gui设置。
设置包含目录</span>
自动化配置和生成</span>
编译器设置</span>
设置标识
设置预处理标识
强制使用g++
设置目标
设置默认生成类型</span>
自定义类型</span>
String
Bool
Comparison
或者
链接到特定库
ITK
ITK目录为:
CMakeLists.txt写为:
VXL
环境变量:
Then in the CMakeLists.txt use:
VTK
Add the path to your environment:
Then in the CMakeLists.txt use:
Boost
假设生成为 ./bjam —prefix=/home/doriad/bin install
需要先修改 .bashrc:
再写cmakelist.txt
OpenCV
Add to the environment:
Then in the CMakeLists.txt use:
Get Help Using a Library
Add new libraries to CMake
Dependency Graph
CTest
Run a specific test by number
e.g. Test 622
Run a range of tests
e.g. Test 622 to 625
Run a test by name
Show verbose output of a test
Create a Test
Link to a library
Create a library
Installing executables
Once your project is built, you can use the ‘install’ make target to copy the executables to the directory specified by CMAKE_INSTALL_PREFIX.
If you get an error like:
you should add:
to your CMakeLists.txt file.
Utilities
Add non-compiled files to a project
This allows files that are not compiled to be added to a project (Qt Creator, for example) while keeping them logically separated from files that are compiled (in the normal add_executable command):