Have you considered having a "superbuild" and using ExternalProject_Add to build the dependencies?
http://www.cmake.org/cmake/help/v3.1/module/ExternalProject.html Excellent examples of using ExternalProject for a superbuild live in the OpenChemistry and Slicer projects. https://github.com/OpenChemistry/openchemistry https://github.com/Slicer/Slicer HTH, David C. On Sat, Jan 10, 2015 at 2:46 AM, Dario Oliveri <oliveridari...@gmail.com> wrote: > How can I wrap cache variables from CMake scripts? Let's say I have a CMake > project, it depends on any third part library (says SFML or SDL), that > project expose a plenty of CACHE variables so that configuring them for each > build manually is a pain. > > How can I configure from MY project THOSE variables so that the final > user/builder does not have to setup that garbage stuff? (say my project has > only 3 cache variables "build_win32", "build_max", "build_linux", I know how > to setup corresponding flags in dependencies, so why I can't do that via > script? having several dependencies could lead to hundreds of Cache > variables, configuring a cross platform build becomes unmaintainable and > error prone, also not every user would be able to do that because require > knowing details about dependencies) > > The assumption is that a project will not use pre-built binaries for > dependencies but will instead include and in-build them (this has plenty > advantages, including ability to re-run unit tests also for dependencies, > catch misconfigurations in build system early, ability to really support > every compiler without having to redownload stuff or compile it manually, > this is the true power of CMAKE, just missing 1 detail to go): > > > add_subdirectory(FOLDER_TO_SDL folder_to_my_bin_dir/SDL) > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake