News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Future Request: Copy source to target if newer

Started by chameleon, April 07, 2012, 09:03:46 PM

Previous topic - Next topic

chameleon

I use OpenCL which has many text files compiled at runtime.
All of these text files must be copied from source directory to target directory (if newer).

There is no a cross-platfrom approach to do this with C::B.

Can we add this option for "Other" files??

Regards.
Pavlos Gessos

MortenMacFly

Quote from: chameleon on April 07, 2012, 09:03:46 PM
There is no a cross-platfrom approach to do this with C::B.
There is, if you use C::B's scripting engine.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

Have you tried using something like:
$(CMD_CP) src/opencl/*.cl bin/opencl
or (more advanced)
[[ if (PLATFORM ==  PLATFORM_MSW) { print (_T("cmd /c xcopy /D /y")); } else { print (_T("sh cp -u")); } ]] src/opencl/*.cl bin/opencl
as a post-build step (see the Code::Blocks manual for details)?

Quote from: MortenMacFly on April 07, 2012, 10:04:52 PM
Quote from: chameleon on April 07, 2012, 09:03:46 PM
There is no a cross-platfrom approach to do this with C::B.
There is, if you use C::B's scripting engine.
Or the copy macro.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: chameleon on April 07, 2012, 08:58:30 PM
Is ok to add a feature request? "Copy source to target if newer".
The forum is not good place to add feature requests. Use the project page at berlios.de
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

chameleon

Hm...
I will work with
[[ if (PLATFORM ==  PLATFORM_MSW) { print (_T("cmd /c xcopy /D /y")); } else { print (_T("sh cp -u")); } ]] src/opencl/*.cl bin/opencl

But I thought something like "copy if newer" option for "Other" files, together with "compile" and "link" option (for every single file).

I am inspired from NetBeans (for Java) where if you have a *.java file, it compiled. If you have e.g. a *.png file, it copied.
(Off course I understand that in C++ there are many things to do with "Other" files instead of simply copy them to target - like intermediate building for something special library as is Qt)

PS: Sorry for off-topic post by the way. I am not "living here" :)