{"id":359341,"date":"2024-05-21T00:30:43","date_gmt":"2024-05-21T00:30:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=359341"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=359341","title":{"rendered":"<span>QCustomPlot + FetchContent<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0444\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443 &#171;QCustomPlot &#8212; \u044d\u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 Qt \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445&#187;. <a href=\"https:\/\/gitlab.com\/DerManu\/QCustomPlot\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> gitlab.<\/p>\n<figure class=\"float bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/b63\/76b\/5ad\/b6376b5ad79fa90e0e6b35ff79cdf962.jpg\" alt=\"\u044d\u043f\u044e\u0440\u0430 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e\" title=\"\u044d\u043f\u044e\u0440\u0430 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e\" width=\"679\" height=\"918\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b63\/76b\/5ad\/b6376b5ad79fa90e0e6b35ff79cdf962.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u044d\u043f\u044e\u0440\u0430 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 <span class=\"habrahidden\">\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e<\/span><\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 2013 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e <a href=\"https:\/\/www.qcustomplot.com\/documentation\/index.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430<\/a>. \u0420\u0430\u0434\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 <a href=\"https:\/\/www.qcustomplot.com\/index.php\/introduction\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>. \u041d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0433\u043e Qt, \u0447\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 <s>\u0436\u0438\u0437\u043d\u044c<\/s>\u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b\/\u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e. \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0432\u0438\u0437\u0438\u044f <em>2.1.1<\/em><strong> <\/strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 qt 6.4.<\/p>\n<p>\u0412 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442c\u043a\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u043f\u0440\u043e\u043c\u0430\u0442-\u0434\u0435\u043c\u043e\u043a, \u0447\u0442\u043e \u0431\u044b\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u0435\u043a \u0438, \u0442\u0430\u043a \u0436\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u0434\u0441\u0430\u0436\u0438\u0432\u0430\u043b \u043d\u0430 \u0441\u0430\u0431\u0436 \u0441\u043e\u043a\u0443\u0440\u0441\u043d\u0438\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0448\u0442\u0430\u0442\u043d\u043e\u0433\u043e, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0432\u0443\u0437\u0430 delphi \u0441 \u0435\u0433\u043e windows forms, qcp \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u0430\u043d\u043e\u0439 \u043d\u0435\u0431\u0435\u0441\u043d\u043e\u0439.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d40\/dff\/1a4\/d40dff1a401109b5973c4860e8597df2.jpg\" alt=\"\u0438\u0433\u0440\u044b \u0441 \u0442\u0435\u0440\u0432\u0435\u0440\u043e\u043c\" title=\"\u0438\u0433\u0440\u044b \u0441 \u0442\u0435\u0440\u0432\u0435\u0440\u043e\u043c\" width=\"1000\" height=\"324\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d40\/dff\/1a4\/d40dff1a401109b5973c4860e8597df2.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0438\u0433\u0440\u044b \u0441 \u0442\u0435\u0440\u0432\u0435\u0440\u043e\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u041b\u0438\u0431\u0430 \u0445\u043e\u0440\u043e\u0448\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u041d\u041e &#8212; \u043d\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 cmake, \u043d\u0443 \u0438\u043b\u0438 \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445. \u0412 \u0430\u0440\u0445\u0438\u0432\u0430\u0445 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u043b\u0435\u0436\u0430\u0442 qmake \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0430 github \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u0435\u043c\u043a\u0430\u043c\u0438.<br \/>\u041f\u043e\u0441\u0438\u0434\u0435\u0432 \u0441 \u0432\u0435\u0447\u0435\u0440, \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0435 \u043a \u0441\u0432\u043e\u0435\u043c\u0443 cmake \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044f \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 cmake.<\/p>\n<p>Cmake \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: \u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e url, \u0432 remote repo, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c. \u042d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f <strong>FetchContent<\/strong>.  \u0425\u0440\u0435\u0441\u0442\u043e\u043c\u0430\u0442\u0438\u0439\u043d\u044b\u0439 <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#typical-case\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u0433\u0434\u0435 \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441:<\/p>\n<pre><code class=\"cmake\">FetchContent_Declare(qcustomplot   URL https:\/\/www.qcustomplot.com\/release\/2.1.1\/QCustomPlot-source.tar.gz )<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c:<\/p>\n<pre><code class=\"cmake\">FetchContent_MakeAvailable(qcustomplot)<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u043f\u0430\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 <code>FetchContent<\/code> \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 CMakeLists.txt \u0438, \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <code>add_submodule(some_extra_dir)<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c FetchContent_MakeAvailable \u044f\u0432\u043d\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#integrating-with-find-package\" rel=\"noopener noreferrer nofollow\">Integrating With find_package<\/a>.<br \/>\u041e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0434\u043b\u044f <code>find_package<\/code>. \u0418\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 <code>find_package(target)<\/code> \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b target \u0432 CMAKE_PREFIX_PATH \u0438 \u043f\u0440\u043e\u0447\u0438\u0445, \u043e\u043d \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043a <code>FetchContent_MakeAvailable<\/code>.<\/p>\n<\/div>\n<\/details>\n<p>QCustomPlot \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u0440\u0435\u043d\u043e\u0432\u043e\u0433\u043e cmake list. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 <code>add_library<\/code>:<\/p>\n<pre><code class=\"cmake\">add_library(qcustomplot   \"${qcustomplot_SOURCE_DIR}\/qcustomplot.h\"   \"${qcustomplot_SOURCE_DIR}\/qcustomplot.cpp\" )<\/code><\/pre>\n<p><code>qcustomplot_SOURCE_DIR<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 MakeAvailable.<br \/>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0438\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b\u043c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u0434\u043e\u0433\u0430\u0434\u043a\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#complex-dependency-hierarchies\" rel=\"noopener noreferrer nofollow\">Complex Dependency Hierarchies<\/a> \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0435\u0433\u043e someFile.c \u043f\u0435\u0440\u0435\u0434 \u044f\u0432\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c add_subdirectory.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u043c\u0438 \u0440\u0435\u043f\u043e \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/conelov\/qcustomplot-fetch\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <code>target_link_libraries<\/code>:<\/p>\n<pre><code class=\"cmake\">target_link_libraries(&lt;you_target>   ...   qcustomplot )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/771924\/\"> https:\/\/habr.com\/ru\/articles\/771924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0444\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443 &#171;QCustomPlot &#8212; \u044d\u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 Qt \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445&#187;. <a href=\"https:\/\/gitlab.com\/DerManu\/QCustomPlot\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> gitlab.<\/p>\n<figure class=\"float bordered full-width\">\n<div><figcaption>\u044d\u043f\u044e\u0440\u0430 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 <span class=\"habrahidden\">\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e<\/span><\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 2013 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e <a href=\"https:\/\/www.qcustomplot.com\/documentation\/index.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430<\/a>. \u0420\u0430\u0434\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 <a href=\"https:\/\/www.qcustomplot.com\/index.php\/introduction\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>. \u041d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0433\u043e Qt, \u0447\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 <s>\u0436\u0438\u0437\u043d\u044c<\/s>\u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b\/\u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e. \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0432\u0438\u0437\u0438\u044f <em>2.1.1<\/em><strong> <\/strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 qt 6.4.<\/p>\n<p>\u0412 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442c\u043a\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u043f\u0440\u043e\u043c\u0430\u0442-\u0434\u0435\u043c\u043e\u043a, \u0447\u0442\u043e \u0431\u044b\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u0435\u043a \u0438, \u0442\u0430\u043a \u0436\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u0434\u0441\u0430\u0436\u0438\u0432\u0430\u043b \u043d\u0430 \u0441\u0430\u0431\u0436 \u0441\u043e\u043a\u0443\u0440\u0441\u043d\u0438\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0448\u0442\u0430\u0442\u043d\u043e\u0433\u043e, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0432\u0443\u0437\u0430 delphi \u0441 \u0435\u0433\u043e windows forms, qcp \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u0430\u043d\u043e\u0439 \u043d\u0435\u0431\u0435\u0441\u043d\u043e\u0439.<\/p>\n<figure class=\"bordered full-width\">\n<div><figcaption>\u0438\u0433\u0440\u044b \u0441 \u0442\u0435\u0440\u0432\u0435\u0440\u043e\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u041b\u0438\u0431\u0430 \u0445\u043e\u0440\u043e\u0448\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u041d\u041e &#8212; \u043d\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 cmake, \u043d\u0443 \u0438\u043b\u0438 \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445. \u0412 \u0430\u0440\u0445\u0438\u0432\u0430\u0445 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u043b\u0435\u0436\u0430\u0442 qmake \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0430 github \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u0435\u043c\u043a\u0430\u043c\u0438.<br \/>\u041f\u043e\u0441\u0438\u0434\u0435\u0432 \u0441 \u0432\u0435\u0447\u0435\u0440, \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0435 \u043a \u0441\u0432\u043e\u0435\u043c\u0443 cmake \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044f \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 cmake.<\/p>\n<p>Cmake \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: \u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e url, \u0432 remote repo, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c. \u042d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f <strong>FetchContent<\/strong>.  \u0425\u0440\u0435\u0441\u0442\u043e\u043c\u0430\u0442\u0438\u0439\u043d\u044b\u0439 <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#typical-case\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u0433\u0434\u0435 \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441:<\/p>\n<pre><code class=\"cmake\">FetchContent_Declare(qcustomplot   URL https:\/\/www.qcustomplot.com\/release\/2.1.1\/QCustomPlot-source.tar.gz )<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c:<\/p>\n<pre><code class=\"cmake\">FetchContent_MakeAvailable(qcustomplot)<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u043f\u0430\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 <code>FetchContent<\/code> \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 CMakeLists.txt \u0438, \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <code>add_submodule(some_extra_dir)<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c FetchContent_MakeAvailable \u044f\u0432\u043d\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#integrating-with-find-package\" rel=\"noopener noreferrer nofollow\">Integrating With find_package<\/a>.<br \/>\u041e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0434\u043b\u044f <code>find_package<\/code>. \u0418\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 <code>find_package(target)<\/code> \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b target \u0432 CMAKE_PREFIX_PATH \u0438 \u043f\u0440\u043e\u0447\u0438\u0445, \u043e\u043d \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043a <code>FetchContent_MakeAvailable<\/code>.<\/p>\n<\/div>\n<\/details>\n<p>QCustomPlot \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u0440\u0435\u043d\u043e\u0432\u043e\u0433\u043e cmake list. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 <code>add_library<\/code>:<\/p>\n<pre><code class=\"cmake\">add_library(qcustomplot   \"${qcustomplot_SOURCE_DIR}\/qcustomplot.h\"   \"${qcustomplot_SOURCE_DIR}\/qcustomplot.cpp\" )<\/code><\/pre>\n<p><code>qcustomplot_SOURCE_DIR<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 MakeAvailable.<br \/>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0438\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b\u043c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u0434\u043e\u0433\u0430\u0434\u043a\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/FetchContent.html#complex-dependency-hierarchies\" rel=\"noopener noreferrer nofollow\">Complex Dependency Hierarchies<\/a> \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0435\u0433\u043e someFile.c \u043f\u0435\u0440\u0435\u0434 \u044f\u0432\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c add_subdirectory.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u043c\u0438 \u0440\u0435\u043f\u043e \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/conelov\/qcustomplot-fetch\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <code>target_link_libraries<\/code>:<\/p>\n<pre><code class=\"cmake\">target_link_libraries(&lt;you_target>   ...   qcustomplot )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/771924\/\"> https:\/\/habr.com\/ru\/articles\/771924\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-359341","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359341"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359341\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}