linuxcmakeconfigureexternal-projectautogen

using autogen.sh with ExternalProject_Add


I try to set ExternalProject_Add in CMakeLists.txt,

for doing this I found this question :

What is the correct usage of CMake EXTERNALPROJECT_ADD with a Git repository?

But I have an issue, I can't call CONFIGURE_COMMAND configure, because I have to call ./autogen.sh to generate configure.ac. I don't find how to make cmake runing ./autogen.sh


Solution

  • From documentation about ExternalProject:

    Any builtin step that specifies a <step>_COMMAND cmd... or custom step that specifies a COMMAND cmd... may specify additional command lines using the form COMMAND cmd.... At build time the commands will be executed in order and aborted if any one fails.

    You may specify several commands for being executed at configure step of external project:

    ExternalProject_Add(<some_project>
       ...
       CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure
    )