c - Current directory in CLion -
i use clion 2016.1. example, run such code in directory ~/clionprojects/tutorial
:
#include <stdio.h> int main() { char * string; string = "hello, everyone"; printf(string); }
why clion go code directory?:
/home/ken/.clion2016.1/system/cmake/generated/tutorial-9a39f70/9a39f70/debug/tutorial hello, process finished exit code 15
how make programs running in "normal" directory ~/clionprojects/tutorial
?
upd
i want read "data.csv" file locates in current directory (where main.c is). clion looks in /home/ken/.clion2016.1/system/cmake/generated/tutorial-9a39f70/9a39f70/debug/tutorial
. how make clion looks data.csv
in ~/clionprojects/tutorial
?
if want appear binaries in folder you've specified, need tell clion adjusting cmakelists.txt this:
set(cmake_runtime_output_directory ${project_source_dir}/bin) set(cmake_archive_output_directory ${project_source_dir}/lib) set(cmake_library_output_directory ${project_source_dir}/lib)
edit:
somehow seems these options not respected in current version of clion (2016.2). therefore 1 might has change desired output directory via: build, execution, deployment | cmake settings , set there.
Comments
Post a Comment