[CMake] Converting a VS Build to CMake/Problems with Post-Build steps, questions

Philip Lowman philip at yhbt.com
Sun Mar 2 21:37:40 EST 2008


On Fri, Feb 29, 2008 at 5:53 AM, Anteru <Anteru at shelter13.net> wrote:

> Problems:
>   * I want to name my debug libraries with a trailing 'd'. I use
> SET_TARGET_PROPERTIES(MyTarget PROPERTIES DEBUG_POSTFIX "d") to do this.
> However, MyTarget is a unit-test runner and I want to execute it using
> ADD_COMMAND as described here
>
> http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_generate_an_executable.2C_then_use_the_executable_to_generate_a_file.3F
> albeit without the output:
>
> GET_TARGET_PROPERTY(PRJ_UT_TARGET MyTarget OUTPUT_NAME)
> ADD_CUSTOM_COMMAND(
>        TARGET MyTarget
>        POST_BUILD
>        COMMAND "${PRJ_UT_TARGET}" VERBATIM
>  )
>
> This works fine for release, but not for debug, as it always returns the
> name without the prefix. How is this supposed to work?


How about GET_TARGET_PROPERTY(var MyTarget DEBUG_LOCATION) followed by a
second ADD_CUSTOM_COMMAND() for the debug binary?

Not exactly the cleanest solution but I think it should work.

  * Is it possible to have x86 & x64 configurations inside a single VC
> solution? During configure, I have to choose either x64 or x86. This is
> nothing serious, I'm just wondering.


Not that I'm aware of.


-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080302/cad92fba/attachment.html


More information about the CMake mailing list