cmakelist获取当前目录
时间: 2023-09-30 16:06:36 浏览: 194
在CMake中,可以使用CMAKE_CURRENT_SOURCE_DIR变量来获取当前CMakeLists.txt的当前目录名(绝对路径)。这个变量指的是当前处理的CMakeLists.txt所在的路径。
通过使用CMAKE_CURRENT_SOURCE_DIR变量,可以方便地获取当前目录的路径,以便在CMakeLists.txt中进行相关配置和操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [CMake获取当前目录名以及获取上层目录名](https://blog.csdn.net/FlushHip/article/details/114677610)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [CMake](https://blog.csdn.net/HITER_Rider/article/details/126119853)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文