[CMake] platform independence '

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Apr 30 07:49:28 EDT 2009


Isn't it the VERBATIM option in custom command ?

On Thu, Apr 30, 2009 at 10:05 AM, Micha Renner <Micha.Renner at t-online.de> wrote:
> Hi,
>
> The following code example works very well with Windows.
>
> ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/atkmarshal.h
>        COMMAND cmake -E echo "#define Brom &&"
>        COMMENT "-- gmarshalAtk Done")
>
> ADD_CUSTOM_TARGET(BuildGmarshal_ATK ALL DEPENDS
> ${CMAKE_CURRENT_BINARY_DIR}/atkmarshal.h)
>
> It echos: #define Brom &&.
>
> On Linux I have two problems:
>
> 1. "#" is interpreted as comment sign, so there is no output
>   COMMAND cmake -E "'#'define... solves this problem, but then
>   I have problems on Windows. The output is '#'define Brom...
> 2. "&&" confuses the shell. make aborts.
>   COMMAND cmake -E "'#'define Brom '&&'" works, but on Windows the
>   output looks like this '#'define Brom '&&'
>
> My question is: Is there platform-independent way to solve these
> problems.
>
> Micha
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Mathieu


More information about the CMake mailing list