当前位置:网站首页>CMake常用命令
CMake常用命令
2022-07-17 00:12:00 【拉面馆子】
CMake常用命令
cmake_minimum_required(VERSION 3.15) #指定cmake最小版本要求
-------------------------------------------------------------------------------------------------
project(demo) #指定工程名称为demo
-------------------------------------------------------------------------------------------------
set(SRC ./src/swap.cpp ./src/demo.cpp) #定义名称为SRC的变量
-------------------------------------------------------------------------------------------------
aux_source_directory(./src SRC) #发现指定目录下所有的源码文件,并将列表存储在一个变量中
-------------------------------------------------------------------------------------------------
include_directories(./include /usr/include) #设置包含目录
-------------------------------------------------------------------------------------------------
link_directories(./lib) #设置库目录
-------------------------------------------------------------------------------------------------
target_link_libraries(demo -lmylib) #添加依赖库
-------------------------------------------------------------------------------------------------
add_executable(demo main.cpp ${
SRC}) #生成可执行文件
-------------------------------------------------------------------------------------------------
add_library(demo [SHARED|STATIC|MODULE] ${
SRC}) #生成库文件
-------------------------------------------------------------------------------------------------
add_compile_options(-Wall -std=c++11 -g -O3) #添加编译参数
-------------------------------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
-------------------------------------------------------------------------------------------------
set(CMAKE_BUILD_TYPE [Debug|Release]) #设置编译类型
-------------------------------------------------------------------------------------------------
持续更新中.......
边栏推荐
- [literature reading] counting integer points in parametric polymers using barvinok's rational functions
- 禁止自作聪明的Safari打开网页时自动播放
- Owl Eyes: Spotting UI Display Issues via Visual Understanding
- 二階邊緣檢測 - Laplacian of Guassian 高斯拉普拉斯算子
- 02 design of smart home system based on ZigBee
- Allegro Design Entry CIS 和 Orcad Capture CIS 关系
- Fair Attribute Classification through Latent Space De-biasing
- Array definition format
- Hue Oozie Editor 调度 shell
- 霍夫变换讲解
猜你喜欢

01 design of intelligent warehouse management system based on RFID

Frustratingly Simple Few-Shot Object Detection

高斯分布的性质(含代码)

Basic principle and parameter interpretation of operational amplifier

中心极限定理

05 design of street lamp control fault detection system based on ZigBee

VGG (Visual Geometry Group)

Fair Attribute Classification through Latent Space De-biasing

03基于ZigBee的城市道路除尘降温系统设计
![[literature reading] multi state MRAM cells for hardware neural computing](/img/55/141cb88dff35d5d0e7af1f860b78df.png)
[literature reading] multi state MRAM cells for hardware neural computing
随机推荐
Owl Eyes: Spotting UI Display Issues via Visual Understanding
递推与递归学习笔记
频率派和贝叶斯派
Differences between saber PSPICE Simulink power supply simulation software
Yolov5训练建议
02 design of smart home system based on ZigBee
动手学深度学习---从全连接层到卷积层篇
Fair Multiple Decision Making Through Soft Interventions
S32K148EVB 关于ENET Loopback实验
Monitor browser return operation - prohibit returning to the previous page
Oozie 集成 Sqoop
Fairness in Semi-supervised Learning: Unlabeled Data Help to Reduce Discrimination
关于1000BASE-T1 1000BASE-TX和100BASE-T1
06基于STM32的智能电子药盒设计
03 design of urban road dedusting and cooling system based on ZigBee
Détection de bord de deuxième ordre laplacien de guassian Gaussian laplacien Operator
Learning Transferable Visual Models From Natural Language Supervision
How to understand volatile and how to use it
动手学深度学习---深度学习计算篇
偏差(bias)和方差(variance)