当前位置:网站首页>CMAKE notes
CMAKE notes
2022-06-22 05:40:00 【alex_ mianmian】
1. How to set relative path to a variable
Here is the folder struct. We run cmake in 'folder_cmake' and we hope to use something in 'my_folder'.
/folder_top/folder_level1/folder_cmake
/folder_top/my_folder
SET(my_variable ${CMAKE_CURRENT_SOURCE_DIR}/../../my_folder)
${CMAKE_CURRENT_SOURCE_DIR} is CMAKE internal variable which save the full path of 'folder_cmake'.
2. Put all sub folder's source files and include files to top folder
in sub folder:
list(APPEND MY_SRCS "a.c"
"b.c")
list(APPEND MY_INCS "a.h"
"b.h")
set(MY_SRCS ${MY_SRCS} TOPPARENT)
set(MY_INCS ${MY_INCS} TOPPARENT)Then you can use MY_SRCS and MY_INCS at the top folder. Will provide example later.
边栏推荐
- Opencv function usage details 1~10, including code examples
- 随鼠标移动的提示框
- Mobile terminal layout adaptation
- From "platform transformation" to "DTC brand going to sea", what is the trend of 2021?
- 独立站 “ 去中心化 ” 模式崛起,席卷跨境企业转型浪潮
- Analysis of 43 cases of MATLAB neural network: Chapter 29 research on the application of limit learning machine in regression fitting and classification -- Comparative Experiment
- 我不建议你工作太拼命
- sourcetree报错ssh失败
- c files always get rebuild when make -------- .PHONY in Makefile
- 代码走查的优化方向(接口请求便捷、动态class判断条件过长、去除无用console、抽离公共方法)
猜你喜欢

【毕业季·进击的技术er】一个读研学生的唠唠嗑

Want to put Facebook ads but don't know where to start? This article takes you to know more about

Yarn application submission process

Tidb performance overview panel

Data storage (Advanced)

Graduation season | a new start, no goodbye

Xshell下载安装(解决评估过期问题)

通达OA漏洞分析合集

数据的存储(进阶)

Record local project startup error: invalid source distribution: 8
随机推荐
tmux -- ssh terminal can be closed without impact the server process
通达OA漏洞分析合集
机器学习笔记 八:Octave实现神经网络的手写数字识别
c files always get rebuild when make -------- . PHONY in Makefile
移动端 realm数据库使用及解耦,跨线程安全使用 OC realm
机器学习笔记 七:强大的神经网络表述
[graduation season · advanced technology Er] a graduate student's chatter
A piece of code to solve the problem of automatic disconnection of Google colab
MinGW下载安装
跨境政策频调整 “ 独立站&平台 ” 哪个才是趋势所在?
独立站 “ 去中心化 ” 模式崛起,席卷跨境企业转型浪潮
\[\e]0;\[email protected]\h: \w\a\]\[\033[01;32m\]\[email protected]\h\[\033[0
Key points of Facebook account "unsealing, anti sealing and maintaining ID" have been collected!
\[\e]0; \[email protected]\h: \w\a\]\[\033[01;32m\]\[email protected]\h\[\033[
中小企业签署ERP合同时,需要留意这几点
Throw away electron and embrace Tauri based on Rust
在线文本代码对比工具
QEMU ARM interrupt system architecture
从“ 平台转型 ”到“ DTC品牌出海 ”,2021趋势何在?
P1077 [noip2012 popularization group] flower display