Use more instructions in building CMake ExternalProject

When use CMake to build ExternalProject:

ExternalProject_Add(
    ......
)

It seems you can’t add multiple same command, for example, PATCH_COMMAND:

ExternalProject_Add(
    ......
    PATCH_COMMAND ......
    PATCH_COMMAND ......
    ......
)

You may get errors like following:

......
File /usr/bin/patch is read-only; trying to patch anyway
/usr/bin/patch: **** Can't create temporary file /usr/bin/patch.oLnbOsk : Permission denied
......

Instead you can COMMAND to add more instructions:

ExternalProject_Add(
    ......
    PATCH_COMMAND ......
    COMMAND ......
    ......
)

References:
CMake ExternalProject_Add: How to build multiple msbuild targets?;
ExternalProject.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.