<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The problem I see with doing this in the current situation is that it isn’t just the CMake module we need. If you look at the changes I called out in my earlier email, there are associated CMake C++ source changes too.<div class=""><br class=""></div><div class="">I also think that one of the limitations I frequently come up against with CMake 2.8.12, is that newer CMake versions accept generator expressions in more places. This is entirely implemented in the CMake C++ code, and there is no way to workaround it in CMake scripts other than not using generator expressions.<br class=""><div class=""><br class=""></div><div class="">-Chris<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 27, 2016, at 12:01 PM, Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com" class="">chuck.atkins@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""> <div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> Replicating ExternalProject would be a lot of work...<br class=""></blockquote><div class=""><br class=""></div></div>One approach commonly used with CMake modules that change frequently upstream is for the project to keep a local copy and have a check in place to use CMake's version if new enough.  For instance, in llvm's source tree:<br class=""><br class="">cmake/modules/ExternalProject.cmake:<br class=""></div><div class="gmail_extra"><span style="font-family:monospace,monospace" class="">if(CMAKE_VERSION VERSION_LESS "3.5.1")<br class=""></span></div><div class="gmail_extra"><span style="font-family:monospace,monospace" class="">  include(${PROJECT_SOURCE_DIR}/cmake/modules/newcmake/ExternalProject.cmake)<br class=""></span></div><div class="gmail_extra"><span style="font-family:monospace,monospace" class="">else()<br class=""></span></div><div class="gmail_extra"><span style="font-family:monospace,monospace" class="">  include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)<br class=""></span></div><div class="gmail_extra"><span style="font-family:monospace,monospace" class="">endif()</span><br class=""><br class=""></div><div class="gmail_extra">cmake/modules/newcmake/ExternalProject.cmake - Copy of the ExternalProject.cmake shipped with 3.5.1<br class=""><br class=""></div><div class="gmail_extra">Then in the top level CMakeLists.txt, just include(ExternalProject).  It will first load the version-check sicne that's in the module path and then load CMake's copy if new enough, otherwise llvm's copy.  This way you can keep the minimum CMake version for the project at 3.4.3, but make sure that your always using ExternaProject from at least 3.5.1.<br class=""><br class=""></div></div>
</div></blockquote></div><br class=""></div></div></div></body></html>