cmake 指定可执行文件生成目录
时间: 2023-08-20 19:09:57 浏览: 268
在CMake中,你可以使用`CMAKE_RUNTIME_OUTPUT_DIRECTORY`来指定可执行文件的生成目录。在主CMakeLists.txt文件中,你可以添加以下代码来设置可执行文件目录:
```
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <目录路径>)
```
其中,`<目录路径>`是你想要指定的可执行文件生成目录的路径。\[3\]通过设置`CMAKE_RUNTIME_OUTPUT_DIRECTORY`,你可以将生成的可执行文件放置在指定的目录中。
#### 引用[.reference_title]
- *1* [cmake 生成可执行程序exe并指定安装目录](https://blog.csdn.net/qq_24423085/article/details/100554072)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [cmake设定可执行文件的输出目录](https://blog.csdn.net/ly890700/article/details/72808345)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [cmake(11):将可执行和库文件分别输出到指定目录](https://blog.csdn.net/rangfei/article/details/121909285)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文