[CMake] Help on ExternalProject_Add

Luigi Calori l.calori at cineca.it
Wed Feb 9 09:07:30 EST 2011


Hi everybody,
I' m trying to use ExternalProject to wrap serveral building recipies 
for different packages I have to use:
I am taking the habit of using it as a replacement of shell scripts or 
manual session for building from source.
In my usage I found some problems, possibly due to my ignorance, so 
please forgive me:

1) I would like to build the same package from the same source multiple 
times (for example because I need to change some config (shared/non shared)
     or build (debug /release) ... I would like to keep a common source 
dir across the different builds...
     So I tried to specify a source dir outside binary dir, but the  the 
download and patch steps seem repeated even if the source is already 
present
     (the download step can be   saved)
     Is this behavior intended or am I missing something?
     I have tried to split the projects in two: one that download and 
patch the source and another that build it, but
     unfortunately the build only project complain that is source dir is 
empty at meta-project configure time.
    The problem seems that the stamp files that decide weather a step 
has to be executed, are collected on the same STAMP_DIR:
    For a previous version of the module, I patched it by adding a 
SOURCE_STAMP_DIR that differentiate the folder where the stamps files 
are kept,
    between  download and patch step, and the other stepsI.
    could that be generally useful? In case I could try to dive in and 
file a feature request + patch

2) Regarding VCS, I see that CVS, SVN and GIT are now supported, I' ve 
to use also Bazaar and Mercurial,
     is it possible to use DOWNLOAD_COMMAND for addressing those, are 
there any examples?
     otherwise would it be useful to add new BZR_REPOSITORY and 
HG_REPOSITORY commands?

3) In case of Cmake based projects,  there seem no way to inherit  
variables or settings from the "meta" project into the ExternalProject 
apart from explicitly listing
     definition variables as CMAKE_ARGS -Dvar1:var1type=${var1} 
-Dvar2:var2type=${var2} .
     Is that tue or there is some other way to do it? ...  and in case, 
is the   vartype needed?


Sorry for the length and thanks a lot in advance

Luigi





More information about the CMake mailing list