Author Topic: Future Request: Copy source to target if newer  (Read 7207 times)

Offline chameleon

  • Multiple posting newcomer
  • *
  • Posts: 39
Future Request: Copy source to target if newer
« on: April 07, 2012, 09:03:46 pm »
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Future Request: Copy source to target if newer
« Reply #1 on: April 07, 2012, 10:04:52 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Future Request: Copy source to target if newer
« Reply #2 on: April 07, 2012, 10:06:19 pm »
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)?

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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Future Request: Copy source to target if newer
« Reply #3 on: April 07, 2012, 10:09:58 pm »
Or the copy macro.
Even simpler - even better. 8)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Future Request: Copy source to target if newer
« Reply #4 on: April 07, 2012, 10:18:32 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!]

Offline chameleon

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Future Request: Copy source to target if newer
« Reply #5 on: April 08, 2012, 01:09:21 am »
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" :)