CLion - 更改默认构建目录 [英] CLion - Changing the default build directory

查看:3772
本文介绍了CLion - 更改默认构建目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过CLion更改构建目录时遇到问题。我试过:
set(CMAKE_RUNTIME_OUTPUT_DIRECTORYbin)但它似乎没有改变,保持不变( / home / adil / .clion10 / system / cmake / generated / c05c962b / c05c962b / Debug / Project )。

我也尝试了指定的解决方法在这里,但这似乎不起作用。

I've been having issues with changing the build directory via CLion. I've tried: set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin") but it does not seem to change and remains the same (/home/adil/.clion10/system/cmake/generated/c05c962b/c05c962b/Debug/Project).
I have also tried the workaround specified here, but that too does not seem to work.

任何人都有这个问题的解决方案?

Does anyone have a solution for this problem?

推荐答案

您需要在 bin 前添加当前您可以使用 $ {CMAKE_CURRENT_SOURCE_DIR}

You need to prefix your bin with the path to the current directory your project resides in. You can use ${CMAKE_CURRENT_SOURCE_DIR}

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")

请务必先添加此

Be sure to add this before related add_executable directive(s) in your CMakeLists.txt file.

这篇关于CLion - 更改默认构建目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆