I thought like you, so I create everything in FooProject/lib/ and copy the DLL to ../bin/Debug/ in a post build step but in DOS MODE (copy).
What is macro ? Is it possible to make generic copy (not depending on target plateform ?
(probably using macros to make it more generic).
What kind of macros ?
I use to copy wxWidgets dll from to bin\output\ I use script like :
[[IO.CopyFile(_("$(#wx)/lib/gcc_dll/wxmsw$(#wxver)ud_gcc.dll"), _("../bin/$(output)/wxmsw$(#wxver)ud_gcc.dll"),false);]]
But it always as me if it is confidence or not... Not really cool to use. Another way ?
[[IO.CopyFile(_("$(#wx)/lib/gcc_dll/wxmsw$(#wxver)ud_gcc.dll"), _("../bin/$(output)/wxmsw$(#wxver)ud_gcc.dll"),false);]]
But it always as me if it is confidence or not... Not really cool to use. Another way ?
Sure. You can use plain (Win32-)SHELL commands, like xcopy or just copy. With macros I meant making use of e.g. $(TARGET_OUTPUT_FILE) or alike...
For example: I've a project that compiles the DLL's and link libs in a .lib folder. Then I setup a batch "make copy.bat" file like this:
@echo off
if not exist "%1" goto PluginNotFound
if "%2"=="" goto MissingPluginName
if exist "..\%2.dll" (
rem copy the file only, if the ARCHIVE flag is set
rem (avoid copying if file is unchanged)
echo Updating %2...
rem D: Only newer files (by date)
rem M: Copy on / and reset archive attribute
rem Y: Answer queries about overwriting with "Yes"
xcopy "%1" .. /D /M /Y
)
if not exist "..\%2.dll" (
echo Copying %2...
copy "%1" ..
)
goto TheEnd
:PluginNotFound
echo Error: Plugin not found.
goto TheEnd
:MissingPluginName
echo Error: Name of the plugin not provided.
goto TheEnd
:TheEnd
As a post-build step I can then use:
make_copy.bat $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_BASENAME)
...for all plugin DLL's I'd like to copy.
Notice that you would need to adjust the path ("..") in the batch file accordingly, so it matches your setup.
Here is what works for me. Say I have a 'fubar' project in
where the 'fubar.cbp' resides. Then I create a 'dynamic dll' target and set the output filename to
and the import library filename to
lib\$(TARGET_OUTPUT_BASENAME)dbg
.The lib folder must be created before building the target.
After I build the target I have a 'foo.dll' in
folder and a 'libfoodbg.a' in
folder as I want them and set them to be. But when I restart CB import library filename setting reverts back to
$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME)
and make me lose the setting. The linker can definitely create the target dll and the import library in different folders so I don't get what doesn't work here to make this setting not saved?
OS: Win 7
CB: svn 7173, May 28 Nightly
MinGW GCC: v4.5.2