{"id":6299,"date":"2022-05-29T20:25:36","date_gmt":"2022-05-29T12:25:36","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=6299"},"modified":"2024-05-05T14:18:54","modified_gmt":"2024-05-05T06:18:54","slug":"cmake-%e9%83%a8%e5%88%86%e5%8f%af%e8%83%bd%e7%94%a8%e5%88%b0%e7%9a%84%e9%a2%84%e5%ae%9a%e4%b9%89%e5%8f%98%e9%87%8f","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=6299","title":{"rendered":"CMake \u90e8\u5206\u53ef\u80fd\u7528\u5230\u7684\u9884\u5b9a\u4e49\u53d8\u91cf"},"content":{"rendered":"\n<p><strong>CMAKE_SYSTEM_NAME<\/strong> \u7cfb\u7edf\u540d\u3002\u6bd4\u5982\u5728 Linux \u4e0b\u503c\u4e3a Linux; \u5728 Windows \u4e0b\u503c\u4e3a Windows<\/p>\n\n\n\n<p><strong>CMAKE_SYSTEM_VERSION<\/strong> \u7cfb\u7edf\u7248\u672c\u3002\u6bd4\u5982\u5f53\u524d\u6211 Ubuntu 20.04 \u7684\u7cfb\u7edf\uff0c\u503c\u4e3a 5.13.0-41-generic\uff08\u5185\u6838\u7248\u672c\uff09<\/p>\n\n\n\n<p><strong>CMAKE_SYSTEM<\/strong> \u76f8\u5f53\u4e8e CMAKE_SYSTEM_NAME + CMAKE_SYSTEM_VERSION<\/p>\n\n\n\n<p><strong>CMAKE_CXX_COMPILER_ID<\/strong> \u7f16\u8bd1\u5668\u540d\u3002\u6bd4\u5982\u4f7f\u7528 gcc\/g++\uff0c\u503c\u4e3a GNU; \u4f7f\u7528 VS \u4e3a MSVC<\/p>\n\n\n\n<p><strong>CMAKE_SYSTEM_PROCESSOR<\/strong> \u5904\u7406\u5668\u67b6\u6784\uff0c\u6bd4\u5982\u6211\u7535\u8111\u4e0a\u503c\u4e3a x86_64<\/p>\n\n\n\n<p><strong>CMAKE_SIZEOF_VOID_P<\/strong> \u8ba1\u7b97\u673a\u4e0a void* \u7684sizeof\u5927\u5c0f\uff0c\u5e38\u7528\u4e8e\u5224\u65ad\u4f4d\u5bbd<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>WIN32<\/strong> \u5728 Windows \u4e0b\u503c\u4e3a\u771f<\/p>\n\n\n\n<p><strong>APPLE<\/strong> \u5728\u82f9\u679c\u4e0b\u503c\u4e3a\u771f<\/p>\n\n\n\n<p><strong>UNIX<\/strong> \u5728 Unix \u53ca Linux \u4e0b\u503c\u4e3a\u771f<\/p>\n\n\n\n<p><strong>ANDROID<\/strong> \u5728\u5b89\u5353\u5f00\u53d1\u73af\u5883\u4e0b\u503c\u4e3a\u771f<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>$ENV{\u7ec8\u7aef\u53d8\u91cf\u540d}<\/strong> \u83b7\u53d6\u7ec8\u7aef\u53d8\u91cf\u503c<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>CMAKE_SOURCE_DIR<\/strong>  \u6700\u9876\u5c42 CMakeLists.txt \u6587\u4ef6\u6240\u5728\u8def\u5f84<\/p>\n\n\n\n<p><strong>CMAKE_CURRENT_SOURCE_DIR<\/strong> \u5f53\u524d CMakeLists.txt \u6587\u4ef6\u6240\u5728\u8def\u5f84<\/p>\n\n\n\n<p><strong>CMAKE_CXX_COMPILER<\/strong> C++ \u7f16\u8bd1\u5668\u8def\u5f84<\/p>\n\n\n\n<p><strong>CMAKE_C_COMPILER<\/strong> C\u8bed\u8a00\u7f16\u8bd1\u5668\u8def\u5f84<\/p>\n\n\n\n<p><strong>CMAKE_BINARY_DIR<\/strong> CMake \u6784\u5efa\u7ed3\u679c\u4fdd\u5b58\u8def\u5f84\u3002\u6bd4\u5982\u4e00\u822c\u521b\u5efa\u4e00\u4e2a build \u76ee\u5f55\uff0c\u5728\u91cc\u9762\u6267\u884c cmake ..\uff0c\u5219\u6b64\u65f6\u8fd9\u4e2a\u53d8\u91cf\u4e3a build \u7684\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CMAKE_SYSTEM_NAME \u7cfb\u7edf\u540d\u3002\u6bd4\u5982\u5728 Linux \u4e0b\u503c\u4e3a Linux; \u5728 Windows \u4e0b\u503c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-6299","post","type-post","status-publish","format-standard","hentry","category-all"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/6299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6299"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/6299\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}