[CMake] CMake 2.8.0 RC 1 ready for testing!

Nathaniel Waisbrot (Cont ARL/CISD) nathaniel.waisbrot at arl.army.mil
Tue Sep 29 09:44:43 EDT 2009


> > - New External Project Module.  The 'ExternalProject_Add' function
> >   creates a custom target to drive download, update/patch, configure,
> >   build, install and test steps of an external project.
> Really interested in trying this new feature: Any example project available?
> Is it intended to be used for CMake based project only or even project
> based on other tools?


Here's an example of building Tcl as an ExternalProject.  I haven't
tried this with 2.8 (just 2.7), but I expect it's the same:

ExternalProject_Add(tcl-8.4.19
  URL "${tarball}/tcl8.4.19-src.tar.gz"
  INSTALL_DIR ${prefix}
  CONFIGURE_COMMAND <SOURCE_DIR>/unix/configure --prefix=<INSTALL_DIR>
)


This creates a CMake target named "tcl-8.4.19".  When the target needs
to be built, it untars the tarball, configures it with the given
command, and then runs "make" and "make install".

The argument list is pretty long and complex, so you'll want to read
through that, but any Gnu-style project with instructions like
"./configure;make;make install" should be easy.




More information about the CMake mailing list