
{"id":4853,"date":"2023-06-08T23:32:10","date_gmt":"2023-06-09T03:32:10","guid":{"rendered":"https:\/\/ikriv.com\/blog\/?p=4853"},"modified":"2023-06-08T23:44:01","modified_gmt":"2023-06-09T03:44:01","slug":"conancmake-how-to-display-actual-compilation-commands","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=4853","title":{"rendered":"Conan+CMake: how to display actual compilation commands?"},"content":{"rendered":"<p>As part of the <code>conanfile.py<\/code>, add the following:<\/p>\n<pre>    def generate(self):\r\n        toolchain = CMakeToolchain(self)\r\n        <b>toolchain.variables['CMAKE_VERBOSE_MAKEFILE'] = 'ON'<\/b>\r\n        toolchain.generate()\r\n        CMakeDeps(self).generate()\r\n<\/pre>\n<p>Build output without CMAKE_VERBOSE_MAKEFILE:<br \/>\n<code>[ 78%] Building CXX object cpp\/test\/unit\/CMakeFiles\/IntegrationTest.cpp.o<\/code><\/p>\n<p>Build output with CMAKE_VERBOSE_MAKEFILE:<br \/>\n<code>[ 78%] Building CXX object cpp\/test\/unit\/CMakeFiles\/csf_api_unit_tests.dir\/src\/IntegrationTest.cpp.o<br \/>\ncd \/opt\/app-root\/.conan\/data\/{stuff} &amp;&amp; \/usr\/bin\/clang++ --gcc-toolchain=\/opt\/app-root\/.conan\/data\/gcc\/7.5.0\/... DBOOST_ALL_DYN_LINK -DCARES_STATICLIB -DCURL_STATICLIB=1 -DFMT_HEADER_ONLY=1 -DSPDLOG_FMT_EXTERNAL -I {more stuff} cpp\/test\/unit\/src\/IntegrationTest.cpp<\/code><\/p>\n<p>Recording this for posterity, since this is totally not obvious.<br \/>\nTo my readers: if you don&#8217;t know what the hell it is about, consider yourself lucky, these are the dirty internals of a build system for C++.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the conanfile.py, add the following: def generate(self): toolchain = CMakeToolchain(self) toolchain.variables[&#8216;CMAKE_VERBOSE_MAKEFILE&#8217;] = &#8216;ON&#8217; toolchain.generate() CMakeDeps(self).generate() Build output without CMAKE_VERBOSE_MAKEFILE: [ 78%] Building CXX object cpp\/test\/unit\/CMakeFiles\/IntegrationTest.cpp.o Build output <a href=\"https:\/\/ikriv.com\/blog\/?p=4853\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[1],"tags":[],"class_list":["entry","author-ikriv","post-4853","post","type-post","status-publish","format-standard","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4853"}],"version-history":[{"count":4,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4853\/revisions"}],"predecessor-version":[{"id":4857,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4853\/revisions\/4857"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}