[CMake] Copying different files during debug/release (was: Re: file1 newer than file2 test)

Jeroen Dierckx jeroen.dierckx at gmail.com
Mon Sep 28 05:44:32 EDT 2009


On Mon, Sep 28, 2009 at 10:04 AM, Fabio Fracassi
<fabio.fracassi at charite.de> wrote:
> Hello James,
>
> James Bigler schrieb:
>>
>> I need to copy dlls into the binary directory, but I want to do it
>> conservatively.  Also I need different versions for Debug and Release, so
>> add_custom_command doesn't work due to the lack of configuration specific
>> dependencies.
>>
>> Ultimately, what I think I'll have to do is generate a script that takes
>> the build configuration as a parameter and runs copy_if_different as a post
>> build command for a given target.
>>
> could you post your script to this list when you are done? I have the same
> Problem (i.e. copying dlls to bin-dir, different for debug/release) and at
> the Moment I am still at a loss how to do it. (especially having different
> source dlls for debug and release).

A lot of developers seem to be in need of configuration-specific
custom build commands. Is it in the bug tracker already?

I am copying the files for each configuration in the cmake run now,
but that obviously isn't conservative enough. I am going to try and
use install commands now, which do support configuration-specific
settings. But I don't like having to build the install target to be
able to debug either, this should really be in a post-build command.

I also don't really like the method you are describing (creating a
post-build script that takes the configuration into account), because
I think it would be too Visual Studio-specific.

But anyway, I think the install method is the closest, and as someone
suggested in another thread, you can always run the install cmake
script as post-build command.

Greetz,
JeDi


More information about the CMake mailing list