<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=TOP&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Build+System+%28cmake%29">Build System (cmake)</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~beagles">Brent Eagles</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >[Official CMake 2.8 Documentation|http://www.cmake.org/cmake/help/cmake-2-8-docs.html] <br>[Official CMake Wiki|http://www.cmake.org/Wiki/CMake] <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">[Asterisk SCF and CMake howto] <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h4. Misc Reading <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h4><a name="BuildSystem%28cmake%29-GeneralInformation"></a>General Information</h4>
<p>As a result of Asterisk SCF being cross-platform from the beginning a build system that was also cross-platform was chosen, CMake. To facilitate CMake usage a common build configuration file has been created which makes creating a cross-platform Asterisk SCF component very easy. The build configuration file (AsteriskSCF.cmake) takes care of dependency checking (for Ice and Boost only at this point), Slice definition compilation, and component compilation (standalone or as an IceBox service) across all platforms. It is highly recommended that this build configuration file be used for all components.</p>

<h4><a name="BuildSystem%28cmake%29-HowCMakeWorks"></a>How CMake Works</h4>
<p>CMake works by interpreting a file written in its own language and generating a build system for a targeted platform. For example on Mac OSX it would generate either a set of GNU Makefiles OR an XCode project file. Once this is done the generated build system is run just like it normally would. </p>

<h4><a name="BuildSystem%28cmake%29-UsingAsteriskSCF.cmake"></a>Using AsteriskSCF.cmake</h4>
<p>The latest documentation for AsteriskSCF.cmake can be found in it's own git repository (asterisk-scf/release/cmake). This directory contains an example component that is built using the AsteriskSCF.cmake infrastructure. The useful information for the build system is contained in the CMakeLists.txt file. Also, all Asterisk SCF components provide CMakeLists.txt that can serve as examples of how to reference the AsteriskSCF.cmake file. </p>

<p>Once you have a CMakeLists.txt properly written you can execute cmake using "cmake ." or use the CMake GUI on Windows or Linux. If any errors occur you will be told what the error is and where it occurred in the file. Once fixed just run cmake again. That's it.</p>

<h4><a name="BuildSystem%28cmake%29-UsefulDocumentation"></a>Useful Documentation</h4>
<p><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html" class="external-link" rel="nofollow">Official CMake 2.8 Documentation</a><br/>
<a href="http://www.cmake.org/Wiki/CMake" class="external-link" rel="nofollow">Official CMake Wiki</a><br/>
<a href="/wiki/display/TOP/Asterisk+SCF+and+CMake+howto" title="Asterisk SCF and CMake howto">Asterisk SCF and CMake howto</a></p>

<h4><a name="BuildSystem%28cmake%29-MiscReading"></a>Misc Reading</h4>
<p><a href="http://lwn.net/Articles/188693/" class="external-link" rel="nofollow">Why the KDE project switched to CMake &#8211; and how</a></p>

<h4><a name="BuildSystem%28cmake%29-Wishlist"></a>Wishlist</h4>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=TOP">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Build+System+%28cmake%29">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=131102&revisedVersion=18&originalVersion=17">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Build+System+%28cmake%29?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>