我尝试在CMakeLists.txt中设置ExternalProject_Add,
为此,我发现了这个问题:
What is the correct usage of CMake EXTERNALPROJECT_ADD with a Git repository?
但我有一个问题,我不能调用CONFIGURE_COMMAND配置,因为我必须调用./autogen.sh来生成configure.ac.
我没有找到如何让cmake运行./autogen.sh
解决方法:
从documentation开始关于ExternalProject:
Any builtin step that specifies a
<step>_COMMAND cmd...
or custom step that specifies aCOMMAND cmd...
may specify additional command lines using the formCOMMAND cmd...
. At build time the commands will be executed in order and aborted if any one fails.
您可以指定在外部项目的配置步骤中执行的几个命令:
ExternalProject_Add(<some_project>
...
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure
)