当前位置:网站首页>Cmake common commands
Cmake common commands
2022-06-11 02:41:00 【Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma,】
project( project name )
# It's necessary
set( Variable name route )
# Defining variables , You can use... Later ${ Variable name } To represent the path
file(GLOB Variable name globbing expression )
# Will produce a match by all globbing A list of expression files , And save it to a variable
file(GLOB_RECURSE Variable name globbing expression )
# And GLOB similar , The difference is that it will traverse all the files in the matching directory and the files under the subdirectories
add_compile_options( Compilation options )
# Add compile options , Such as -g -std=c++17 -O2
include_directories( Header file path )
# Add header file search path
link_directories( Library file base path )
# Specify the base path of the library file , Must be written in add_executable Before
# Library files are compiled programs , Using library files instead of source files can greatly reduce compilation time
# Library files are divided into static library and dynamic library . Static libraries are linked to the object code when the program is compiled .
# Dynamic library ( Shared library ) When the program is compiled, it is not linked to the object code , It is loaded only when the program is running ;
# When different programs need the same library , You only need to have a copy of the shared library in memory , Avoid the waste of space ;
# And it will be loaded at runtime , It also solves the update of static library to program , The trouble of deployment and release
add_executable( Generate executable file name Path to the file to compile 1 Path to the file to compile 2 ...)
# It's necessary
target_link_libraries( Generate executable file name Library file path )
# Link shared library , Must be written in add_executable after
边栏推荐
- 378. the k-th smallest element in an ordered matrix
- cmake常用命令
- String operation methods: replace, delete and split strings
- CPT 102_LEC 17
- AOSP ~ WiFi on by default + GPS off by default + Bluetooth off by default + rotary screen off
- Android WiFi hide SSID configuration method
- 重磅直播!ORB-SLAM3系列之特征匹配(MLPnP、词袋模型等)。
- SD3.0笔记
- Unity3d model skin changing technology
- Jetpack compose scaffold and bottomappbar (bottom navigation)
猜你喜欢

【斐波那契数列】

Istio installation and use
![[MySQL 45 lecture -12] lecture 12 the reason why MySQL has a wind attack from time to time](/img/db/aeadbc4f3189a9809592d2a4714d22.jpg)
[MySQL 45 lecture -12] lecture 12 the reason why MySQL has a wind attack from time to time

Link list of high frequency written interview question brushing summary (distribution explanation & code annotation)

码农的进阶之路 | 每日趣闻

学习太极创客 — ESP8226 (二)

Project load failed

MySQL备份与恢复

Metal organic framework materials (fe-mil-53, mg-mof-74, ti-kumof-1, fe-mil-100, fe-mil-101) supported on isoflurane / methotrexate / doxorubicin (DOX) / paclitaxel / ibuprofen / camptothecin

Jetpack compose scaffold and bottomappbar (bottom navigation)
随机推荐
Manon's advanced road - Daily anecdotes
SQL | return customer name, relevant order number and total price of each order
error exepected identifier before ‘(‘ token, grpc 枚举类编译错误
Flat data to tree and tree data flattening
Write my Ini configuration file error
ADVANCE. AI CEO Shoudong will share the compliance of cross-border e-commerce using AI technology at the 2022 emerging market brands online Summit
Looking at the ups and downs of the mobile phone accessories market from the green Union's sprint for IPO
Stc8a8k64d4 EEPROM read / write failure
Technology sharing | quick intercom, global intercom
靠贴牌飞利浦冲击上市,德尔玛的自有品牌又该如何“起跳”?
ADVANCE.AI首席执行官寿栋将在2022新兴市场品牌出海线上峰会分享跨境电商运用AI技术合规
Add SQL formatter to vscode to format SQL
蓝桥杯_小蓝吃糖果_鸽巢原理 / 抽屉原理
P4338 [zjoi2018] history (tree section) (violence)
【斐波那契数列】
Can Xiaoxiang life become the "Yonghui" in the discount industry after the completion of the round a financing of tens of millions of yuan?
Problems with JDBC tool classes
Navicat Premium 15 工具自动被杀毒防护软件删除解决方法
同一个用户的两次请求SessionId竟然不一致-----记录问题
[189. rotation array]