Re: [CMake] ExternalProject: avoiding rebuilds
As an extreme example, consider using boost's header-only libraries. If I point external project at a boost tarball, every time I rebuild (or make clean; make), CMake will re-extract the tarball, which is quite slow for a tarball with so many files. Why does CMake re-extract tarballs at all? When would this behavior be desirable? On Mon, Sep 26, 2011 at 10:37 AM, Ben Medina wrote: > John is right. The external project may be at the bottom of a chain of > (my own) project dependencies. I need to preserve the ability to > easily rebuild just my projects (and their dependencies), not external > projects. Think of ExternalProject as a replacement for pre-built > libraries, and you'll see where I'm coming from. > > Perhaps I need to file a feature request on Mantis. > > On Sat, Sep 24, 2011 at 2:32 AM, John Drescher wrote: >> On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer wrote: >>> Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina: Hello all, I'm trying to adopt greater usage of ExternalProject in my project. One problem I'd like to resolve is spurious rebuilds of external projects. >>> >>> [...] >>> This works great: building "test" first untars the CLAPACK source and builds it, as expected. However, if I rebuild test (i.e. in Visual Studio, right-click on test and rebuild), then the CLAPACK tarball get extracted *again*, and a full rebuild of CLAPACK happens. I'd expect that, unless the tarball is changed, a rebuild of the external project is a no-op. Is there a way to achieve my desired behavior? >>> >>> Yes, use the correct option. Rebuild means "rebuild this target and all of >>> it's dependencies". There is a different option, something like "rebuild >>> only >>> this target". Just use this one. >>> >> >> That may be difficult in practice. I mean I typically have 20 to 40 >> targets in my projects and sometimes I would want them all rebuilt. >> However I there is a batch build option in Visual Studio that can be >> used for that. In this case you check which targets you want built so >> you can click select all and then uncheck the external project. >> >> John >> -- >> >> 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 >> > -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
In general it's better to make your project into an ExternalProject itself, and have it depend on all other ExternalProject upon which it depends. That way all prerequisites get built, and then your package get built. It ensures that all prerequisites are fully built and installed before your project is configured. You can specify DOWNLOAD_COMMAND as "" and set SOURCE_DIR to your project's source directory, in which case ExternalProject_add doesn't try and download your source. Slicer has a trick for doing this with a single top-level CMakeLists.txt that works like this option(Do_SuperBuild "Build all prerequisites and this project" ON) if(Do_SuperBuild) # build prerequisites... Project(SuperBuild) #now build this project ExternalProjectAdd(MyProject DEPENDS dependency_list SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CMAKE_ARGS -DDo_SuperBuild:BOOL=OFF ) else(Do_SuperBuild) # # all the CMake stuff to build your program endif(Do_SuperBuild) On Mon, Sep 26, 2011 at 12:45 PM, Rolf Eike Beer wrote: > Am Montag, 26. September 2011, 10:37:57 schrieb Ben Medina: >> John is right. The external project may be at the bottom of a chain of >> (my own) project dependencies. I need to preserve the ability to >> easily rebuild just my projects (and their dependencies), not external >> projects. Think of ExternalProject as a replacement for pre-built >> libraries, and you'll see where I'm coming from. >> >> Perhaps I need to file a feature request on Mantis. > > You may try, but I don't think that this will help. AFAICT this "clean and > then rebuild" stuff is a Visual Studio thing. > > Eike > -- > > 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 > -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
It's the same as "make clean; make", so it's not just a Visual Studio thing. On Mon, Sep 26, 2011 at 10:45 AM, Rolf Eike Beer wrote: > Am Montag, 26. September 2011, 10:37:57 schrieb Ben Medina: >> John is right. The external project may be at the bottom of a chain of >> (my own) project dependencies. I need to preserve the ability to >> easily rebuild just my projects (and their dependencies), not external >> projects. Think of ExternalProject as a replacement for pre-built >> libraries, and you'll see where I'm coming from. >> >> Perhaps I need to file a feature request on Mantis. > > You may try, but I don't think that this will help. AFAICT this "clean and > then rebuild" stuff is a Visual Studio thing. > > Eike > -- > > 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 > -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
Am Montag, 26. September 2011, 10:37:57 schrieb Ben Medina: > John is right. The external project may be at the bottom of a chain of > (my own) project dependencies. I need to preserve the ability to > easily rebuild just my projects (and their dependencies), not external > projects. Think of ExternalProject as a replacement for pre-built > libraries, and you'll see where I'm coming from. > > Perhaps I need to file a feature request on Mantis. You may try, but I don't think that this will help. AFAICT this "clean and then rebuild" stuff is a Visual Studio thing. Eike signature.asc Description: This is a digitally signed message part. -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
John is right. The external project may be at the bottom of a chain of (my own) project dependencies. I need to preserve the ability to easily rebuild just my projects (and their dependencies), not external projects. Think of ExternalProject as a replacement for pre-built libraries, and you'll see where I'm coming from. Perhaps I need to file a feature request on Mantis. On Sat, Sep 24, 2011 at 2:32 AM, John Drescher wrote: > On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer wrote: >> Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina: >>> Hello all, >>> >>> I'm trying to adopt greater usage of ExternalProject in my project. >>> One problem I'd like to resolve is spurious rebuilds of external >>> projects. >> >> [...] >> >>> This works great: building "test" first untars the CLAPACK source and >>> builds it, as expected. However, if I rebuild test (i.e. in Visual >>> Studio, right-click on test and rebuild), then the CLAPACK tarball get >>> extracted *again*, and a full rebuild of CLAPACK happens. I'd expect >>> that, unless the tarball is changed, a rebuild of the external project >>> is a no-op. >>> >>> Is there a way to achieve my desired behavior? >> >> Yes, use the correct option. Rebuild means "rebuild this target and all of >> it's dependencies". There is a different option, something like "rebuild only >> this target". Just use this one. >> > > That may be difficult in practice. I mean I typically have 20 to 40 > targets in my projects and sometimes I would want them all rebuilt. > However I there is a batch build option in Visual Studio that can be > used for that. In this case you check which targets you want built so > you can click select all and then uncheck the external project. > > John > -- > > 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 > -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer wrote: > Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina: >> Hello all, >> >> I'm trying to adopt greater usage of ExternalProject in my project. >> One problem I'd like to resolve is spurious rebuilds of external >> projects. > > [...] > >> This works great: building "test" first untars the CLAPACK source and >> builds it, as expected. However, if I rebuild test (i.e. in Visual >> Studio, right-click on test and rebuild), then the CLAPACK tarball get >> extracted *again*, and a full rebuild of CLAPACK happens. I'd expect >> that, unless the tarball is changed, a rebuild of the external project >> is a no-op. >> >> Is there a way to achieve my desired behavior? > > Yes, use the correct option. Rebuild means "rebuild this target and all of > it's dependencies". There is a different option, something like "rebuild only > this target". Just use this one. > That may be difficult in practice. I mean I typically have 20 to 40 targets in my projects and sometimes I would want them all rebuilt. However I there is a batch build option in Visual Studio that can be used for that. In this case you check which targets you want built so you can click select all and then uncheck the external project. John -- 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
Re: [CMake] ExternalProject: avoiding rebuilds
Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina: > Hello all, > > I'm trying to adopt greater usage of ExternalProject in my project. > One problem I'd like to resolve is spurious rebuilds of external > projects. [...] > This works great: building "test" first untars the CLAPACK source and > builds it, as expected. However, if I rebuild test (i.e. in Visual > Studio, right-click on test and rebuild), then the CLAPACK tarball get > extracted *again*, and a full rebuild of CLAPACK happens. I'd expect > that, unless the tarball is changed, a rebuild of the external project > is a no-op. > > Is there a way to achieve my desired behavior? Yes, use the correct option. Rebuild means "rebuild this target and all of it's dependencies". There is a different option, something like "rebuild only this target". Just use this one. Eike signature.asc Description: This is a digitally signed message part. -- 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
[CMake] ExternalProject: avoiding rebuilds
Hello all, I'm trying to adopt greater usage of ExternalProject in my project. One problem I'd like to resolve is spurious rebuilds of external projects. For example, I'd like to build CLAPACK as an external project, so I do something like this: ExternalProject_Add (clapack URL ${tarball_location} URL_MD5 4fd18eb33f3ff8c5d65a7d43913d661b UPDATE_COMMAND "" CMAKE_CACHE_ARGS "${clapack_cmake_args}" INSTALL_COMMAND "" ) add_executable (test main.cpp) add_dependencies(test clapack) This works great: building "test" first untars the CLAPACK source and builds it, as expected. However, if I rebuild test (i.e. in Visual Studio, right-click on test and rebuild), then the CLAPACK tarball get extracted *again*, and a full rebuild of CLAPACK happens. I'd expect that, unless the tarball is changed, a rebuild of the external project is a no-op. Is there a way to achieve my desired behavior? I have another external project where the source is checked into my source tree. A rebuild on that external project is a no-op unless the source files have changed. However, I'd rather avoid checking in 3rdparty source code into my source tree. Thanks, Ben -- 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