[CMake] ExternalProject + Patch command

David Cole david.cole at kitware.com
Wed Mar 16 12:37:18 EDT 2011


It would be nice (as a future feature addition) to be able to support
sharing the download/update/patch/source_dir aspects of an
ExternalProject target among multiple configurations and avoid the
multiple runs of these things that are exactly the same independent of
the config.

Until that dream becomes reality, though.....

You could run a script as the PATCH_COMMAND, and put some sort of "has
this patch already been applied to this source tree" logic into the
script, and only actually do the patch command if not already applied.

It's a work-around, and might be ugly, but it should work.


HTH,
David


On Wed, Mar 16, 2011 at 11:40 AM, Johan Björk <phb at spotify.com> wrote:
> Hi everyone,
>
>
> I'm using an SVN repository and a PATCH command. It seems to work
> fine, but when I'm selecting a different build configuration, all
> steps will be executed again (as expected), but it results in my patch
> being applied twice.
>
> Any ideas how to work around this?
>
> My externalProject command for reference:
>
>    ExternalProject_Add(Breakpad
>      SVN_REPOSITORY http://google-breakpad.googlecode.com/svn/trunk/
>      UPDATE_COMMAND ""
>      CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
> -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
> -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
>      PATCH_COMMAND patch <
> ${CMAKE_CURRENT_LIST_DIR}/other/patches/breakpad.patch
>    )
>
> Thanks
> /Johan
> _______________________________________________
> 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
>


More information about the CMake mailing list