From 4ab5c2378ae66d2be7554d8ebaa0f1f41f885d7d Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Tue, 29 Jul 2025 11:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=B3=E4=BA=8Enlohmann?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 4 ++-- Convention/CMakeLists.txt | 1 + Convention/[nlohmann] | 1 - [Test]/CMakeLists.txt | 1 + [Test]/test.cpp | 24 ++++-------------------- 5 files changed, 8 insertions(+), 23 deletions(-) delete mode 160000 Convention/[nlohmann] diff --git a/.gitmodules b/.gitmodules index 5530f41..f9f740e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "Convention/[nlohmann]"] - path = Convention/[nlohmann] +[submodule "Convention/nlohmann"] + path = Convention/nlohmann url = https://github.com/nlohmann/json.git diff --git a/Convention/CMakeLists.txt b/Convention/CMakeLists.txt index b040b06..09d3bc6 100644 --- a/Convention/CMakeLists.txt +++ b/Convention/CMakeLists.txt @@ -1,5 +1,6 @@ message("Convention: --- ----- ----- ----- ----- --") +include_directories(${PROJECT_SOURCE_DIR}/Convention/nlohmann/include) install(DIRECTORY [Runtime] DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.*" diff --git a/Convention/[nlohmann] b/Convention/[nlohmann] deleted file mode 160000 index d33ecd3..0000000 --- a/Convention/[nlohmann] +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d33ecd3f3bd11e30aa8bbabb00e0a9cd3f2456d8 diff --git a/[Test]/CMakeLists.txt b/[Test]/CMakeLists.txt index 9ffed7d..f0bc9ae 100644 --- a/[Test]/CMakeLists.txt +++ b/[Test]/CMakeLists.txt @@ -1,4 +1,5 @@ add_executable(TEST test.cpp ) include_directories(${PROJECT_SOURCE_DIR}/Convention/[Runtime]) +include_directories(${PROJECT_SOURCE_DIR}/Convention/nlohmann/include) install(TARGETS TEST RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) \ No newline at end of file diff --git a/[Test]/test.cpp b/[Test]/test.cpp index d23f05d..c15c27e 100644 --- a/[Test]/test.cpp +++ b/[Test]/test.cpp @@ -1,26 +1,10 @@ -//#include"Config.hpp" -#include"Architecture.hpp" +#include +#include using namespace std; - -#include -#include -#include -using namespace std; +using namespace Convention; int main() { - double t = 0; - for (int i = 1; i < 80; i++) - { - t += 1.0 / (double)i; - } - double k = 0; - for (int i = 1; i < 80; i++) - { - k += 1.0 / (double)i; - cout << i << ":\t" << k << "/" << t << "\t=\t" << k / t * 100 << "% current step:\t" << - 1.0 / (double)i << endl; - } - return 0; + cout << ProjectConfig().LoadProperties().FindItem("test", "test") << endl; }