当前位置:网站首页>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
边栏推荐
- Looking at the ups and downs of the mobile phone accessories market from the green Union's sprint for IPO
- [MySQL 45 lecture -12] lecture 12 the reason why MySQL has a wind attack from time to time
- How to guarantee the data quality of data warehouse?
- 从绿联冲刺IPO,看手机配件市场沉浮录
- error exepected identifier before ‘(‘ token, grpc 枚举类编译错误
- GCC C inline assembly
- Dynamically add attributes to objects
- How to fix syntax errors in WordPress websites
- SQL | external connection
- 1031. maximum sum of two non overlapping subarrays
猜你喜欢

Manon's advanced road - Daily anecdotes

微信小程序
![[AI weekly] AI and freeze electron microscopy reveal the structure of](/img/2e/e986a5bc44526f686c407378a9492f.png)
[AI weekly] AI and freeze electron microscopy reveal the structure of "atomic level" NPC; Tsinghua and Shangtang proposed the "SIM" method, which takes into account semantic alignment and spatial reso

When a logical deletion encounters a unique index, what are the problems and solutions?

Uni app - one click access to user information

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

Necessity for banks to choose electronic bidding procurement

CPT 102_LEC 15

How to add cookie pop-up window in WordPress website (without plug-in)

When the interviewer opens his mouth, he comes to compose. Is this the case now?
随机推荐
HOSATAPD_ CLI debug using WiFi whitelist
Executeineditmode property details
Introduction to the functions of today's headline search webmaster platform (portal)
How to fix syntax errors in WordPress websites
Jetpack compose box control
net core天马行空系列-可用于依赖注入的,数据库表和c#实体类互相转换的接口实现
Penetration test - security service system +owasp top 10
软件测试英语常见词汇
WordPress upgrade error: briefly unavailable for scheduled maintenance [resolved]
GCC C内联汇编
How to add cookie pop-up window in WordPress website (without plug-in)
What can the enterprise exhibition hall design bring to the enterprise?
【189. 轮转数组】
【面试题 17.04. 消失的数字】
Common vocabulary of software testing English
Whether the software test needs to master the programming ability
error exepected identifier before ‘(‘ token, grpc 枚举类编译错误
剑指 Offer II 079. 所有子集
One line of code solves the problem that the time to fetch datetime from MySQL database is less than eight hours
app 测试 常用 adb 命令集合