<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1066418568;
        mso-list-type:hybrid;
        mso-list-template-ids:2044871316 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi all~<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I have been experimenting in my project with using ExternalProject_Add.&nbsp; My goal is to make our build process more automated, with less headache to get up and started developing on a fresh system.&nbsp; I decided that boost would be a great
 dependency to automate, which I successfully completed and is a HUGE help. I would like also like to ask the community to code review what I did, and possibly offer feedback.&nbsp; I also have my own comments with the experience.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">My code for review (this was developed only for windows, for now):<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">include( ExternalProject )<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">set( Boost_Version 1.49.0 )<o:p></o:p></p>
<p class="MsoNormal">string( REPLACE &quot;.&quot; &quot;_&quot; Boost_Version_Underscore ${Boost_Version} )<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">message( STATUS &quot;Boost_Version: &quot; ${Boost_Version} )<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"># Below is a CMake command to download, build and install Boost on the user&#8217;s computer<o:p></o:p></p>
<p class="MsoNormal">ExternalProject_Add(<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">Boost<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/boost<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URL http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URL_MD5 854dcbbff31b896c85c38247060b7713<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UPDATE_COMMAND &quot;bootstrap.bat&quot;<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONFIGURE_COMMAND &quot;&quot;<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BUILD_COMMAND bjam --with-program_options address-model=64 toolset=msvc-11.0 link=static stage<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BUILD_IN_SOURCE 1<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSTALL_COMMAND &quot;&quot;<o:p></o:p></p>
<p class="MsoNormal">)<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">set_property( TARGET Boost PROPERTY FOLDER &quot;Externals&quot;)<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">ExternalProject_Get_Property( Boost source_dir )<o:p></o:p></p>
<p class="MsoNormal">ExternalProject_Get_Property( Boost binary_dir )<o:p></o:p></p>
<p class="MsoNormal">set( Boost_INCLUDE_DIRS ${source_dir} )<o:p></o:p></p>
<p class="MsoNormal">set( Boost_LIBRARIES debug;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-gd-1_49.lib;optimized;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-1_49.lib )<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">A few of my comments while developing this.&nbsp;&nbsp; Boost&#8217;s native build system is called Jam.&nbsp; However, there are efforts to port Boost to cmake, available either on github or gitorious.&nbsp; I would rather stick with one build system and use cmake,
 but I could not use either of these repositories with ExternalProject_Add.&nbsp; <o:p>
</o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>Github appears to only use the https protocol, and the cmake file( download &#8230; ) command does not appear to handle this protocol.&nbsp; So, I think GitHub is verboten for any ExternalProject_Add.&nbsp; Am I right, or am I missing something?&nbsp; Any
 plans to add https support?<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>ExternalProject_Add checks the file extension of the URL download, to &#8216;verify&#8217; the download is a supported package.&nbsp; I would actually like to request that it not verify the file extension.&nbsp; A lot of these public code repositories offer
 tarball and zipball downloads, but the links they provide are forwarding scripts (and they don&#8217;t offer you direct links), and oftentimes the URL to use has no extension.&nbsp; I had this problem with both github and gitorious.&nbsp; I think it has to be left to the
 user to verify that the link they use if valid.<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>The official subversion repository of boost offers .7z packages to download.&nbsp; These packages are about half the size of .zips.&nbsp; Will cmake add decompression support for 7z archives in the near future?<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">4.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>ExternalProject_Add will download, configure and build projects at &#8216;build&#8217; time.&nbsp; From the documentation, this sounded like a design decision.&nbsp; However, this means that you can&#8217;t use the already robust and mature findboost() module to
 configure the Boost project.&nbsp; Would it be possible to add support to ExternalProject_Add to work at &#8216;configure&#8217; time?&nbsp; Maybe a flag to choose when to pay the build cost?&nbsp; This would help me abstract the differences between linux and windows, for instance.&nbsp;
 I understand that some people care that &#8216;configure&#8217; is fast, but I would prefer not to rewrite the logic already in the findboost packge.&nbsp; Also, if ExternalProject_Add worked at &#8216;configure&#8217; time, then I would think that it would be possible for the findboost
 package maintainer to incorporate ExternalProject_Add into the find module itself.&nbsp; Then, users could pass a possible flag into findBoost that says, &#8216;if you don&#8217;t find boost locally on the system, just download the lastest version of boost for me and proceed
 with configuring.&#8217;<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks in advance for comments,<o:p></o:p></p>
<p class="MsoNormal">Kent<o:p></o:p></p>
</div>
</body>
</html>