{"id":5364,"date":"2021-05-16T09:55:14","date_gmt":"2021-05-16T16:55:14","guid":{"rendered":"https:\/\/mattfife.com\/?p=5364"},"modified":"2023-04-25T19:34:28","modified_gmt":"2023-04-26T02:34:28","slug":"out-of-source-builds","status":"publish","type":"post","link":"https:\/\/mattfife.com\/?p=5364","title":{"rendered":"Out of Source CMake Build Example"},"content":{"rendered":"\n<p>Build systems are certainly not the sexy parts of software development. However, no part of the development process impacts your team so much as it&#8217;s build system. Build systems that perform poorly, regularly break, or generate inconsistent or confusing output files are one of the fastest ways to introduce bugs, slow releases, and bring a whole team to a screeching halt. That&#8217;s why automated reproducible builds are a keystone of agile development.<\/p>\n\n\n\n<p>Out-of-source builds are one way to improve your build system. Out-of-source building is a practice that keeps the generated\/compiled intermediate and binary files&nbsp;out of the&nbsp;source file directories. Traditionally, most build systems would generate object, binary, and intermediate files mixed right next to their source files. This leads to a confusing hierarchy of files that made getting a consistent picture of your build and source nearly impossible on big projects. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5366\" data-permalink=\"https:\/\/mattfife.com\/?attachment_id=5366\" data-orig-file=\"https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?fit=771%2C719&amp;ssl=1\" data-orig-size=\"771,719\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?fit=640%2C597&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?resize=341%2C318&#038;ssl=1\" alt=\"\" class=\"wp-image-5366\" width=\"341\" height=\"318\" srcset=\"https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?w=771&amp;ssl=1 771w, https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?resize=300%2C280&amp;ssl=1 300w, https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?resize=768%2C716&amp;ssl=1 768w, https:\/\/i0.wp.com\/mattfife.com\/wp-content\/themes\/mattTheme\/headerimgs\/2021\/05\/image.png?resize=290%2C270&amp;ssl=1 290w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/figure>\n\n\n\n<p>It turns out CMake can help you create our of source builds with just a few little tricks. Unfortunately, there were few examples and many of them were overly complex. So, to help get folks started, I wrote up a very simple sample. It&#8217;s the perfect starting point for your next project. It works with both Linux and Visual Studio builds. <\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/mattfife\/BasicOutOfSourceCMake\">https:\/\/github.com\/mattfife\/BasicOutOfSourceCMake<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build systems are certainly not the sexy parts of software development. However, no part of the development process impacts your team so much as it&#8217;s build system. Build systems that perform poorly, regularly break, or generate inconsistent or confusing output files are one of the fastest ways to introduce bugs, slow releases, and bring a whole team to a screeching halt. That&#8217;s why automated reproducible builds are a keystone of agile development. Out-of-source builds are one way to improve your&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/mattfife.com\/?p=5364\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,7,5],"tags":[],"class_list":["post-5364","post","type-post","status-publish","format-standard","hentry","category-technicalproblemsolutions","category-technicalprogramming","category-technical"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4WECr-1ow","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/5364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5364"}],"version-history":[{"count":2,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/5364\/revisions"}],"predecessor-version":[{"id":8658,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/5364\/revisions\/8658"}],"wp:attachment":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}