<div dir="ltr">In response to myself I've figure it out with using add_step function and calling some commands.<div><br></div><div>Full source for what's working building both external libraries.</div><div><br></div><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}</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><br></div><div>ExternalProject_Get_Property(sdl install_dir)</div><div>SET(SDL_INSTALL_DIR ${install_dir})</div><div><br></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>    COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./autogen.sh #this works</div><div><br></div><div>    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure</div><div>                      --prefix=${SDL_INSTALL_DIR}</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>ExternalProject_Get_Property(sdl_image install_dir)</div><div>SET(SDL_IMAGE_INSTALL_DIR ${install_dir})</div></div><div><br></div><div>this installs the sdl things in</div><div>build-tree/lib</div><div>build-tree/include</div><div>build-tree/share</div><div><br></div><div>but even if I try to hardcode the path's they don't get picked up. The other libraries not build with external project add cannot find those files. How do I get those files to be picked up by the regular cmake build?</div><div><br></div><div>Also I have one further question though they might be related and can be solved at the same time.</div><div><br></div><div>I would like to add this to my external projects, their include directories are located in </div><div><div>TARGET_INCLUDE_DIRECTORIES(sdl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 15, 2015 at 8:47 PM, Owen Hogarth II <span dir="ltr"><<a href="mailto:gurenchan@gmail.com" target="_blank">gurenchan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">http://hg.libsdl.org/SDL</a></div><div>    UPDATE_COMMAND hg pull -u <a href="http://hg.libsdl.org/SDL" target="_blank">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/" target="_blank">http://hg.libsdl.org/SDL_image/</a></div><div>    UPDATE_COMMAND hg pull -u <a href="http://hg.libsdl.org/SDL_image/" target="_blank">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" target="_blank">configure.ac</a>' or m4 files included by '<a href="http://configure.ac" target="_blank">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" target="_blank">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" target="_blank">http://www.gnu.org/software/autoconf</a>></div><div>         <<a href="http://www.gnu.org/software/m4/" target="_blank">http://www.gnu.org/software/m4/</a>></div><div>         <<a href="http://www.perl.org/" target="_blank">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>
</blockquote></div><br></div>