Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Cinolt on November 02, 2010, 08:07:35 pm

Title: Copying "Other" Files to Bin
Post by: Cinolt on November 02, 2010, 08:07:35 pm
I have included in my project a file called "custom.ini". During build-time, I don't want it to be compiled, but just to be copied to the bin directory with the binary files. What is the proper way to do this in Code::Blocks?
Title: Re: Copying "Other" Files to Bin
Post by: stahta01 on November 02, 2010, 08:31:52 pm
I would do pre or post build step.

Tim S.
Title: Re: Copying "Other" Files to Bin
Post by: Cinolt on November 02, 2010, 08:42:59 pm
Could you please provide an example of what I should enter into the pre/post build step?
Title: Re: Copying "Other" Files to Bin
Post by: stahta01 on November 02, 2010, 08:46:44 pm
Could you please provide an example of what I should enter into the pre/post build step?

No, read the wiki and try to figure it out.

http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks#Preprocessing_phase
Title: Re: Copying "Other" Files to Bin
Post by: Jenna on November 03, 2010, 07:31:01 am
"Project -> Build options -> [project|target] -> Pre/Post build steps"
Title: Re: Copying "Other" Files to Bin
Post by: BrightRaven on November 16, 2010, 03:34:56 am

I had a similar problem where I needed to copy data files from a folder in my project folder (\data\) to the \bin\debug\ folder.

This is what I used.

From the tool bar open: "Project -> Build options -> [project|target] -> Pre/Post build steps"

In the "Post-build steps" text box put : cmd /c copy ".\data" "$(TARGET_OUTPUT_DIR)\data\"

In my case, this will copy all the files from \data into \bin\debug\data.

Remember to create the folder you want to copy the files into (i.e. the  \bin\debug\data folder) otherwise it causes an error.

Also, check the "always execute, even if target is up-to-date.". It helps when you're editing the "Other" files and re-testing but not modifying the source files.

Hope this helps :D