当前位置:网站首页>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.
边栏推荐
- Link a static library‘s all sections
- 网络、IO流、反射、多线程、异常
- open source hypervisor
- Tidb upgrade version
- Gerrit Code Review Setup
- [graduation season · advanced technology Er] a graduate student's chatter
- Use of jedispool
- C语言指针(进阶)
- QEMU ARM interrupt system architecture 2
- 2022 Shanxi secondary vocational group "Cyberspace Security" event module b- web page penetration
猜你喜欢

Implementation of Nacos server source code

搜狗输入法无法输出中文

JS regular expression to implement the thousands separator

2022 Shanxi secondary vocational group "Cyberspace Security" event module b- web page penetration

P1318 ponding area

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
![P1061 [NOIP2006 普及组] Jam 的计数法](/img/53/7ca41b2ed4084f49ebcc2dd47e5919.png)
P1061 [NOIP2006 普及组] Jam 的计数法

A piece of code to solve the problem of automatic disconnection of Google colab

Facebook账户 “ 解封、防封、养号 ” 知识要点,已收藏!

Network, IO flow, reflection, multithreading, exception
随机推荐
Analysis of 43 cases of MATLAB neural network: Chapter 28 Application Research of decision tree classifier - breast cancer diagnosis
跨境政策频调整 “ 独立站&平台 ” 哪个才是趋势所在?
Jedissentinel tool class
C#中Cookie设置与读取
Small and medium-sized enterprises should pay attention to these points when signing ERP contracts
The benefits of implementing the standard of intellectual property in Miyun District, Beijing, with a subsidy of 50000-100000 yuan
Prompt box moving with the mouse
Network, IO flow, reflection, multithreading, exception
Shenzhen Nanshan District specialized special new small giant enterprise declaration index, with a subsidy of 500000 yuan
Summary of knapsack problem
Amazon and independent station are not simply two choices
c files always get rebuild when make -------- .PHONY in Makefile
QEMU ARM interrupt system architecture 2
基于WebUploader实现大文件分片上传
Leetcode hot1-50
错误:note: module requires Go 1.17
在线文本代码对比工具
vscode 远程连接错误:Server status check failed - waiting and retrying
网络、IO流、反射、多线程、异常
用简单方法实现对象的深克隆封装js