[CMake] external project add and configure

Owen Hogarth II gurenchan at gmail.com
Tue Dec 15 07:47:48 EST 2015


I was able to build the external project that required cmake like this:
include(ExternalProject)

ExternalProject_Add(sdl
    HG_REPOSITORY http://hg.libsdl.org/SDL
    UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL

    CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib

    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL

    INSTALL_DIR ${CMAKE_BINARY_DIR}
    )
ExternalProject_Get_Property(sdl install_dir)
SET(SDL_INSTALL_DIR ${install_dir})


now this second file uses ./configure to set up it's environment.
I can build it by going into the folder first running ./autogen.sh then
./configure ...

or If I use this external project script below
ExternalProject_Add(sdl_image
    DEPENDS sdl
    HG_REPOSITORY http://hg.libsdl.org/SDL_image/
    UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/

    # MAKE_COMMAND make
    CONFIGURE_COMMAND  ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
    --prefix=${SDL_INSTALL_DIR}/lib
#adding this prefix I get further in my build then I get an error

    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image

    INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
    )

error:
missing: line 81: aclocal-1.13:
 command not found
WARNING: 'aclocal-1.13' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>

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.

How can I run the autogen.sh command from within that
"ExternalProject_Add(sdl_image ..)" block?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151215/c7211c77/attachment.html>


More information about the CMake mailing list