Where does CLION store executables?

I install CLion on Ubuntu 14.04. I create my first project using CMakeLists.txt:

Original file:

#include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; } 

CMakeLists.txt:

 cmake_minimum_required(VERSION 2.8.4) project(sh) set(SOURCE_FILES main.cpp) add_executable(sh ${SOURCE_FILES}) 

My source file is in / home / user / Desktop / sh . But after the build, I do not see the executable in this folder. Where is it?

+51
c ++ cmake jetbrains clion
Sep 14 '14 at 17:32
source share
2 answers

When you create under CLION,

enter image description here

It prints the path where it sends the executable to the console:

 -- Build files have been written to: /home/<user>/.clion10/system/cmake/generated/8bd932b1/8bd932b1/Debug1 

To change this parameter File > Settings... and in the CMake settings, enter the desired subdirectory name (for example, "bin") in the "Working directory" field:

enter image description here

(To use the new output path, you may need to Run> Clean).

+80
Jan 28 '15 at 19:34
source share

When you launch the program, it shows the location at the top of the Run window:

 /home/me/.clion10/system/cmake/generated/ad2f5c60/ad2f5c60/Debug/HelloCLion Hello, World! Process finished with exit code 0 

You can change this location by changing CMAKE_RUNTIME_OUTPUT_DIRECTORY :

 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "/home/me/ClionProjects/Binaries") 
+51
Sep 14 '14 at 17:40
source share



All Articles