CLion - change the default assembly directory

I am having problems changing the assembly directory through CLion. I tried: set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin") , but it does not seem to change and remains unchanged ( /home/adil/.clion10/system/cmake/generated/c05c962b/c05c962b/Debug/Project ).
I also tried the workaround indicated here , but this does not work either.

Does anyone have a solution to this problem?

+24
intellij-idea cmake clion
Nov 08 '14 at 17:02
source share
4 answers

You need to tell bin path to the current directory where your project is located. You can use ${CMAKE_CURRENT_SOURCE_DIR}

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

Be sure to add this before the appropriate add_executable directives in the CMakeLists.txt file.

+36
Dec 18 '14 at 13:20
source share

The erased answer is correct, just add that you must put the set directive before the add_executable directive, and before the set directive, where the source files are defined for add_executable , if you do not, the output will be the same and errors will not be triggered.

+4
Apr 05 '15 at 23:34
source share

You can use set_target_properties:

 set_target_properties( YOUR_PROJECT PROPERTIES RUNTIME_OUTPUT_DIRECTORY "YOUR_BUILD_DIRECTORY") 
+3
Nov 17 '14 at 15:43
source share

Go to Settings β†’ CMake and specify the relative or absolute passage in which you want your assembly files to be saved in the "Create an output path" field. For example. / bin will output assembly files in the file YourProject / bin / Debug / yourExeFile.exe

enter image description here

+2
Nov 17 '16 at 16:42
source share



All Articles