{"id":2206,"date":"2015-12-30T11:04:44","date_gmt":"2015-12-30T18:04:44","guid":{"rendered":"http:\/\/mattfife.com\/?p=2206"},"modified":"2016-01-05T11:17:02","modified_gmt":"2016-01-05T18:17:02","slug":"cmake-with-compilers-that-need-custom-parameters","status":"publish","type":"post","link":"https:\/\/mattfife.com\/?p=2206","title":{"rendered":"CMake with compilers that need custom parameters"},"content":{"rendered":"<p>When using CMake\u00a0on non-GCC\/non-Microsoft compilers &#8211; you often run into interesting problems. Especially true for embedded devices\/cross-compilers.<\/p>\n<p>One thing that can bite you is the fact that CMake requires the compiler to pass a &#8216;smoke&#8217; test. Unfortunately, if there are required parameters for your compiler, the smoke test part will fail.<\/p>\n<p>There are a few ways to solve this, the &#8216;recommended&#8217; way seems to be via\u00a0the CMAKE_FORCE_C_COMPILER\/CMAKE_FORCE_CXX_COMPILER flags. This allows you to tell CMake\u00a0what the compiler is and pass the smoke test.<\/p>\n<p>CMAKE_FORCE_C_COMPILER(\/usr\/mycc\/cxint86 GNU)<br \/>\nCMAKE_FORCE_CXX_COMPILER(\/usr\/mycc\/cxxint86 GNU)<\/p>\n<p>Here are the docs for more information<br \/>\n<a href=\"https:\/\/cmake.org\/Wiki\/CMake_Cross_Compiling#The_toolchain_file\" target=\"_blank\">https:\/\/cmake.org\/Wiki\/CMake_Cross_Compiling#The_toolchain_file<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using CMake\u00a0on non-GCC\/non-Microsoft compilers &#8211; you often run into interesting problems. Especially true for embedded devices\/cross-compilers. One thing that can bite you is the fact that CMake requires the compiler to pass a &#8216;smoke&#8217; test. Unfortunately, if there are required parameters for your compiler, the smoke test part will fail. There are a few ways to solve this, the &#8216;recommended&#8217; way seems to be via\u00a0the CMAKE_FORCE_C_COMPILER\/CMAKE_FORCE_CXX_COMPILER flags. This allows you to tell CMake\u00a0what the compiler is and pass the&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/mattfife.com\/?p=2206\"> 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":false,"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-2206","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-zA","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/2206","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=2206"}],"version-history":[{"count":4,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/2206\/revisions"}],"predecessor-version":[{"id":2210,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/2206\/revisions\/2210"}],"wp:attachment":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}