<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> </o:p></p>
<p class="MsoNormal">I have been experimenting in my project with using ExternalProject_Add. My goal is to make our build process more automated, with less headache to get up and started developing on a fresh system. 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. I also have my own comments with the experience.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </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> </o:p></p>
<p class="MsoNormal">include( ExternalProject )<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">set( Boost_Version 1.49.0 )<o:p></o:p></p>
<p class="MsoNormal">string( REPLACE "." "_" Boost_Version_Underscore ${Boost_Version} )<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">message( STATUS "Boost_Version: " ${Boost_Version} )<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"># Below is a CMake command to download, build and install Boost on the user’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"> PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/boost<o:p></o:p></p>
<p class="MsoNormal"> URL http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip<o:p></o:p></p>
<p class="MsoNormal"> URL_MD5 854dcbbff31b896c85c38247060b7713<o:p></o:p></p>
<p class="MsoNormal"> UPDATE_COMMAND "bootstrap.bat"<o:p></o:p></p>
<p class="MsoNormal"> CONFIGURE_COMMAND ""<o:p></o:p></p>
<p class="MsoNormal"> BUILD_COMMAND bjam --with-program_options address-model=64 toolset=msvc-11.0 link=static stage<o:p></o:p></p>
<p class="MsoNormal"> BUILD_IN_SOURCE 1<o:p></o:p></p>
<p class="MsoNormal"> INSTALL_COMMAND ""<o:p></o:p></p>
<p class="MsoNormal">)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">set_property( TARGET Boost PROPERTY FOLDER "Externals")<o:p></o:p></p>
<p class="MsoNormal"><o:p> </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> </o:p></p>
<p class="MsoNormal">A few of my comments while developing this. Boost’s native build system is called Jam. However, there are efforts to port Boost to cmake, available either on github or gitorious. I would rather stick with one build system and use cmake,
but I could not use either of these repositories with ExternalProject_Add. <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 "Times New Roman"">
</span></span><![endif]>Github appears to only use the https protocol, and the cmake file( download … ) command does not appear to handle this protocol. So, I think GitHub is verboten for any ExternalProject_Add. Am I right, or am I missing something? 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 "Times New Roman"">
</span></span><![endif]>ExternalProject_Add checks the file extension of the URL download, to ‘verify’ the download is a supported package. I would actually like to request that it not verify the file extension. A lot of these public code repositories offer
tarball and zipball downloads, but the links they provide are forwarding scripts (and they don’t offer you direct links), and oftentimes the URL to use has no extension. I had this problem with both github and gitorious. 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 "Times New Roman"">
</span></span><![endif]>The official subversion repository of boost offers .7z packages to download. These packages are about half the size of .zips. 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 "Times New Roman"">
</span></span><![endif]>ExternalProject_Add will download, configure and build projects at ‘build’ time. From the documentation, this sounded like a design decision. However, this means that you can’t use the already robust and mature findboost() module to
configure the Boost project. Would it be possible to add support to ExternalProject_Add to work at ‘configure’ time? Maybe a flag to choose when to pay the build cost? This would help me abstract the differences between linux and windows, for instance.
I understand that some people care that ‘configure’ is fast, but I would prefer not to rewrite the logic already in the findboost packge. Also, if ExternalProject_Add worked at ‘configure’ time, then I would think that it would be possible for the findboost
package maintainer to incorporate ExternalProject_Add into the find module itself. Then, users could pass a possible flag into findBoost that says, ‘if you don’t find boost locally on the system, just download the lastest version of boost for me and proceed
with configuring.’<o:p></o:p></p>
<p class="MsoNormal"><o:p> </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>