[CMake] Different output files based on build_type

James Bigler jamesbigler at gmail.com
Tue May 19 19:26:17 EDT 2009


On Thu, May 14, 2009 at 4:51 PM, Clinton Stimpson <clinton at elemtech.com>wrote:

> James Bigler wrote:
>
>> I need to specify different output files for an add_custom_command for
>> different build types in VS.  The output file also needs to be added to an
>> add_executable command.
>>
>> I'm not sure how to go about this.
>>
>> Any pointers would be helpful.
>>
>
> How about something like this.
>
> set(myoutput_file
> "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/out.txt")
> add_custom_command(${myoutput_file}
>  COMMAND mycommand ${myoutput_file} )
>
> add_executable (app ${SOURCES} ${myoutput_file})
>
>
> The same works with generators that don't have configuration types (such as
> a makefile).
>
> Clint
>

Using CMAKE_CFG_INTDIR worked great!

Thanks,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090519/277e62de/attachment.htm>


More information about the CMake mailing list