{"id":1351,"date":"2023-03-19T10:01:32","date_gmt":"2023-03-19T02:01:32","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1351"},"modified":"2023-04-29T09:03:16","modified_gmt":"2023-04-29T01:03:16","slug":"compile-and-install-cmake-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/19\/compile-and-install-cmake-under-centos\/","title":{"rendered":"CentOS\u4e0b\u7f16\u8bd1\u5b89\u88c5CMake"},"content":{"rendered":"<p>CMake\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u5b89\u88c5\uff08\u7f16\u8bd1\uff09\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u7b80\u5355\u7684\u8bed\u53e5\u6765\u63cf\u8ff0\u6240\u6709\u5e73\u53f0\u7684\u5b89\u88c5(\u7f16\u8bd1\u8fc7\u7a0b)\u3002\u80fd\u591f\u8f93\u51fa\u5404\u79cd\u5404\u6837\u7684makefile\u6216\u8005project\u6587\u4ef6\uff0c\u80fd\u6d4b\u8bd5\u7f16\u8bd1\u5668\u6240\u652f\u6301\u7684C++\u7279\u6027\uff0c\u7c7b\u4f3cUNIX\u4e0b\u7684automake\uff0c\u53ea\u662f CMake \u7684\u7ec4\u6001\u6863\u53d6\u540d\u4e3a CMakeLists.txt\u3002Cmake \u5e76\u4e0d\u76f4\u63a5\u5efa\u6784\u51fa\u6700\u7ec8\u7684\u8f6f\u4ef6\uff0c\u800c\u662f\u4ea7\u751f\u6807\u51c6\u7684\u5efa\u6784\u6863\uff08\u5982 Unix \u7684 Makefile \u6216 Windows Visual C++ \u7684 projects\/workspaces\uff09\uff0c\u7136\u540e\u518d\u4f9d\u4e00\u822c\u7684\u5efa\u6784\u65b9\u5f0f\u4f7f\u7528\u3002<\/p>\n<p><!-- more --><\/p>\n<p>\u5b98\u7f51\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/cmake.org\">https:\/\/cmake.org<\/a><\/p>\n<pre><code># wget https:\/\/cmake.org\/files\/v3.10\/cmake-3.10.1.tar.gz\n# tar -zxf cmake-3.10.1.tar.gz\n# cd cmake-3.10.1\n# .\/bootstrap\n# gmake\n# make install\n# cmake -version<\/code><\/pre>\n<p>\u82e5\u62a5\u9519\uff1aCMake Error: Could not find CMAKE_ROOT !!!<\/p>\n<p>\u5378\u8f7d\u65e7\u7248\u672cCMake\uff0c\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5CMake\u5373\u53ef<\/p>\n<pre><code># yum remove cmake<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>CMake\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u5b89\u88c5\uff08\u7f16\u8bd1\uff09\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u7b80\u5355\u7684\u8bed\u53e5\u6765\u63cf\u8ff0\u6240\u6709\u5e73\u53f0\u7684\u5b89\u88c5(\u7f16\u8bd1\u8fc7\u7a0b)\u3002\u80fd\u591f\u8f93\u51fa\u5404\u79cd\u5404\u6837\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[333],"tags":[337],"class_list":["post-1351","post","type-post","status-publish","format-standard","hentry","category-install-deploy","tag-cmake"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1351"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1351\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}