[CMake] EXTERNALPROJECT_ADD and AlwaysCreate

Yves Martelli ymartelli at cistib.upf.edu
Mon Feb 21 09:00:23 EST 2011


Dear All,
I'm trying to use the ExternalProject functionality. I'm under Microsoft Windows 7 and using Microsoft Visual Studio 2010 with CMake 2.8.4. It's a simple test, trying to compile some classes that need ITK, so I have an:

    EXTERNALPROJECT_ADD(
        ITK-ext
        GIT_REPOSITORY "http://itk.org/ITK.git"
        GIT_TAG "v3.20.0"
        CMAKE_ARGS
            -DBUILD_SHARED_LIBS:BOOL=ON
            -DBUILD_TESTING:BOOL=OFF
            -DBUILD_EXAMPLES:BOOL=OFF
            -DITK_USE_OPTIMIZED_REGISTRATION_METHODS:BOOL=ON
            -DITK_USE_REVIEW:BOOL=ON
        INSTALL_COMMAND ""
        UPDATE_COMMAND ""
    )

My problem is that it works fine the first time (download and compile ITK and my project). But every time after, when I build, it tries to download ITK again, which I do not want (only the first time is enough). The output of visual studio is:

1>------ Build started: Project: ITK-ext, Configuration: Debug x64 ------
1>Build started 21/02/2011 14:31:54.
1>InitializeBuildStatus:
1>  Creating "x64\Debug\ITK-ext\ITK-ext.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>CustomBuild:
1>  Creating directories for 'ITK-ext'
1>  Performing download step (git clone) for 'ITK-ext'
...

I thought that the UPDATE_COMMAND "" would solve this but it does not. Can I deactivate this "AlwaysCreate"?

Thanks,
Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110221/8a4d7a61/attachment.htm>


More information about the CMake mailing list