[CMake] ExternalProject_add: Does it have to rebuild every time you run make?

David Cole david.cole at kitware.com
Tue Apr 13 14:11:09 EDT 2010


Well of course you're not doomed. If you were doomed, cmake would print out
"you are doomed" in the console output......

Since you are doing a cvs repository checkout of a specific (presumably
static and immutable) tag using the -r argument, you can specify:
  UPDATE_COMMAND ""
for the tcl and tk external projects...

The problem is that repository based checkouts assume they have to be
updated to be "current", when in fact, in this case, you do not need the cvs
update step. (Since you are using a tag that should always retrieve the same
content from the repo.)

Using UPDATE_COMMAND "" should prevent the tcl and tk builds from rebuilding
all the time, which in turn, should prevent VTK from rebuilding unless there
is an actual change before it to trigger a rebuild....


HTH,
David



On Tue, Apr 13, 2010 at 2:04 PM, kent williams <nkwmailinglists at gmail.com>wrote:

> So if I use large libraries as ExternalProject builds, am I doomed to
> have everything rebuild every time I run Make?  Every time I type make
> at the top level of my tree, it does every step of every external
> project build.
>
> This wouldn't be so terrible, but if Tcl and Tk get re-installed, then
> VTK will recompile everything including a Tcl or Tk header.
>
> Below I have my CMakeLists.txt that I'm currently working with.
>
> ========================CMakeLists.txt==============================================
> project(TclTkVtk)
> cmake_minimum_required(VERSION 2.8)
> cmake_policy(VERSION 2.8)
> set(CMAKE_VERBOSE_MAKEFILE on)
> enable_testing()
> include(Dart)
> include(CPack)
> include(ExternalProject)
>
> find_package( Qt4 REQUIRED )
> if(QT_USE_FILE)
>  include(${QT_USE_FILE})
>  set(QT_USE_QTXML 1)
> else(QT_USE_FILE)
>  set( QT_LIBRARIES   ${QT_QT_LIBRARY})
> endif(QT_USE_FILE)
>
> SET(QT_CMAKE_FLAGS
> -DVTK_USE_QT:BOOL=ON
> -DVTK_USE_QVTK:BOOL=ON
> -DVTK_USE_GUISUPPORT:BOOL=ON
> -DDESIRED_QT_VERSION:STRING=4
> -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
> )
>
> if(APPLE)
> set(QT_CMAKE_FLAGS ${QT_CMAKE_FLAGS}
> -DVTK_USE_CARBON:BOOL=OFF
> -DVTK_USE_COCOA:BOOL=ON
> -DVTK_USE_X:BOOL=OFF
> )
> set(LIB_EXT dylib)
> set(EXTRA_TK_FLAGS
> --enable-aqua
> --enable-corefoundation
> )
> else(APPLE)
> set(QT_CMAKE_FLAGS ${QT_CMAKE_FLAGS}
> -DVTK_USE_CARBON:BOOL=OFF
> -DVTK_USE_COCOA:BOOL=OFF
> -DVTK_USE_X:BOOL=ON
> )
> set(LIB_EXT .so)
> endif(APPLE)
>
> SET(LOCAL_CMAKE_BUILD_OPTIONS
>  -DMAKECOMMAND:STRING=${MAKECOMMAND}
>  -DCMAKE_SKIP_RPATH:BOOL=ON
>  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
>  -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
>  -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
>  -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
>  -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
>  -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
>  -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
>  -DBUILD_EXAMPLES:BOOL=OFF
>  -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
>  -DBUILD_TESTING:BOOL=OFF
>  -DCMAKE_GENERATOR:STRING=${CMAKE_GENERATOR}
>  -DCMAKE_EXTRA_GENERATOR:STRING=${CMAKE_EXTRA_GENERATOR}
>  -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
>  -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
>  -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
>  -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
>  -DCMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH=${CMAKE_BUNDLE_OUTPUT_DIRECTORY}
>  -DDART_TESTING_TIMEOUT:STRING=${DART_TESTING_TIMEOUT}
>  -DMEMORYCHECK_COMMAND_OPTIONS:STRING=${MEMORYCHECK_COMMAND_OPTIONS}
>  -DMEMORYCHECK_COMMAND:PATH=${MEMORYCHECK_COMMAND}
>  -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
>  -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
>  -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
>  -DSITE:STRING=${SITE}
>  -DBUILDNAME:STRING=${BUILDNAME}
>  ${QT_CMAKE_FLAGS}
> )
>
> set(TCL_DEPEND TCL)
> set(proj TCL)
> ExternalProject_Add(${proj}
> CVS_REPOSITORY ":pserver:anonymous:@tcl.cvs.sourceforge.net:/cvsroot/tcl"
> CVS_TAG -r core-8-5-7
> CVS_MODULE  "tcl"
> CONFIGURE_COMMAND  CMAKE_C_COMPILER="${CMAKE_C_COMPILER}"
> CMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}"
> ${CMAKE_CURRENT_BINARY_DIR}/TCL-prefix/src/TCL/unix/configure
> --prefix=${CMAKE_CURRENT_BINARY_DIR}
> )
>
> set(TK_DEPEND TK)
> set(proj TK)
> ExternalProject_Add(${proj}
> CVS_REPOSITORY ":pserver:anonymous:@tcl.cvs.sourceforge.net:
> /cvsroot/tktoolkit"
> CVS_TAG -r core-8-5-7
> CVS_MODULE  "tk"
> CONFIGURE_COMMAND  CMAKE_C_COMPILER="${CMAKE_C_COMPILER}"
> CMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}"
> ${CMAKE_CURRENT_BINARY_DIR}/TK-prefix/src/TK/unix/configure
> --prefix=${CMAKE_CURRENT_BINARY_DIR}
> --with-tcl=${CMAKE_CURRENT_BINARY_DIR}/lib ${EXTRA_TK_FLAGS}
> DEPENDS ${TCL_DEPEND}
> )
>
>
> #
> # build VTK
> # -DVTK_USE_TK:BOOL=yes
> set(VTK_DEPEND VTK)
> set(proj VTK)
>
> ExternalProject_Add(${proj}
> CVS_REPOSITORY ":pserver:anonymous at public.kitware.com:/cvsroot/VTK"
> CVS_TAG -r VTK-5-4-2
> CVS_MODULE "VTK"
> CMAKE_ARGS ${LOCAL_CMAKE_BUILD_OPTIONS} -DVTK_WRAP_TCL:BOOL=ON
> -DTCL_INCLUDE_PATH:PATH=${CMAKE_CURRENT_BINARY_DIR}/include
> -DTK_INCLUDE_PATH:PATH=${CMAKE_CURRENT_BINARY_DIR}/include
> -DTCL_LIBRARY:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/lib/libtk8.5.${LIB_EXT}
> -DTK_LIBRARY:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/lib/libtcl8.5.${LIB_EXT}
> -DTCL_TCLSH:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/bin/tclsh8.5
> INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
> DEPENDS ${TCL_DEPEND} ${TK_DEPEND}
> )
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100413/db25986a/attachment-0001.htm>


More information about the CMake mailing list