Reputation: 1736
Suppose I'm writing a code to read from a file and printing its content, and I'm modifying its content so often that I need it to be visible from the projects tool view. The problem is that KDevelop forces me to build the code in a separate folder (i.e. build folder). So the project structure goes like this.
--> Project Folder
|
--> code.cpp
--> file.txt
--> build
|
--> code (exe file)
Now building and executing the project won't work as expected, because file.txt
is not beside the executable file, so it can't read its content.
Moving file.txt
into build folder won't work as it will exclude it from the projects tool view in KDevelop (i.e. I can't access the file from the left pane in KDevelop).
Creating a shortcut of file.txt and moving it into build folder so the file is besides the source code, and its shortcut is in build folder will do it, but for every time I want to rename the file, I need to create a new shortcut or rename the one in build folder.
What should I do? I think it can be handled by one of two ways.
Building the project in the same folder as the source code and file.txt. But KDevelop won't allow me to do so producing the error message The selected build directory is not empty
.
Allowing me to add a text file to the Projects tool view without being physically inside the project folder. This way I can create the file inside the build folder, and access or modify it from the Projects tool view, but seems there's no option for this in KDevelop.
Are there any suggestions? I've tried QtCreator and it allows me to do both.
Upvotes: 0
Views: 790
Reputation: 3851
The usual way to handle this case is to use an additional install step after building. In this step the final binaries from the build directory and additional files from the source directory are copied to a third location.
How this is achieved depends on the build system you employ.
Upvotes: 1