0

Suppose I have the next projects structure (to be more convient let assume that QtCreator is used as IDE):

|
|-build_minGW
|-build_msvs
|-...
|-Project
 |-src
 |-inc
 |-...

Moreover, suppose I want to use some .json files to store settings of my program. So after every compilation program should be run from the respective 'build' folder. Where should I create this .json files (Project folder, 'build' folder or elsewhere)? Is it any common and correct way to do this automaticaly (e.g. if I create files in Project folder, they should be copied to the every build directory)?

Stanislav
  • 73
  • 8
  • JSON config file storage seems to be run-time problem? Then if the answer is Yes where you keep it is a design question. – Alexander V May 26 '19 at 14:15
  • @AlexanderV thank you for your answer. Maybe I've asked slightly incorrect so will try to rephrase. Consider that I want to load json files from the binary's program (after it is compiled). Where should I create json file in my Project's folder and how could I make it copying to the every build's directories? Is there any common practice? – Stanislav May 27 '19 at 10:18
  • Your program itself may create that file even with all default values to start with wherever it can in the system. Otherwise you can do the trick QMAKE_POST_LINK and DEST_DIR or so: https://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output Or that QMAKE_POST_LINK may run whatever program to create that JSON file. – Alexander V May 27 '19 at 13:49

0 Answers0