<div dir="ltr">I was able to build the external project that required cmake like this:<div><div>include(ExternalProject)</div><div><br></div><div>ExternalProject_Add(sdl</div><div>    HG_REPOSITORY <a href="http://hg.libsdl.org/SDL">http://hg.libsdl.org/SDL</a></div><div>    UPDATE_COMMAND hg pull -u <a href="http://hg.libsdl.org/SDL">http://hg.libsdl.org/SDL</a></div><div><br></div><div>    CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE</div><div>    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib</div><div><br></div><div>    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL</div><div><br></div><div>    INSTALL_DIR ${CMAKE_BINARY_DIR}</div><div>    )</div><div>ExternalProject_Get_Property(sdl install_dir)</div><div>SET(SDL_INSTALL_DIR ${install_dir})</div><div><br></div><div><br></div><div>now this second file uses ./configure to set up it's environment.</div><div>I can build it by going into the folder first running ./autogen.sh then ./configure ...</div><div><br></div><div>or If I use this external project script below</div><div>ExternalProject_Add(sdl_image</div><div>    DEPENDS sdl</div><div>    HG_REPOSITORY <a href="http://hg.libsdl.org/SDL_image/">http://hg.libsdl.org/SDL_image/</a></div><div>    UPDATE_COMMAND hg pull -u <a href="http://hg.libsdl.org/SDL_image/">http://hg.libsdl.org/SDL_image/</a></div><div><br></div><div>    # MAKE_COMMAND make</div><div>    CONFIGURE_COMMAND  ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure</div><div>    --prefix=${SDL_INSTALL_DIR}/lib </div><div>#adding this prefix I get further in my build then I get an error</div><div><br></div><div>    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image</div><div><br></div><div>    INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}</div><div>    )</div></div><div><div><br></div><div>error:</div><div>missing: line 81: aclocal-1.13:</div><div> command not found</div><div>WARNING: 'aclocal-1.13' is missing on your system.</div><div>         You should only need it if you modified 'acinclude.m4' or</div><div>         '<a href="http://configure.ac">configure.ac</a>' or m4 files included by '<a href="http://configure.ac">configure.ac</a>'.</div><div>         The 'aclocal' program is part of the GNU Automake package:</div><div>         <<a href="http://www.gnu.org/software/automake">http://www.gnu.org/software/automake</a>></div><div>         It also requires GNU Autoconf, GNU m4 and Perl in order to run:</div><div>         <<a href="http://www.gnu.org/software/autoconf">http://www.gnu.org/software/autoconf</a>></div><div>         <<a href="http://www.gnu.org/software/m4/">http://www.gnu.org/software/m4/</a>></div><div>         <<a href="http://www.perl.org/">http://www.perl.org/</a>></div></div><div><br></div><div>I can't actually get cmake to run the autogen script for me. If I leave and manually go run ./autogen.sh and then re-run this cmake command things will built correctly.</div><div><br></div><div>How can I run the autogen.sh command from within that "ExternalProject_Add(sdl_image ..)" block?</div></div>