🎉 init(cmake): init modern cmake template

This commit is contained in:
clzhao20
2024-04-08 15:22:45 +08:00
commit 120ef25b84
18 changed files with 285 additions and 0 deletions

4
apps/CMakeLists.txt Normal file
View File

@@ -0,0 +1,4 @@
add_executable(app app.cpp)
target_compile_features(app PRIVATE cxx_std_17)
target_link_libraries(app PRIVATE modern_library fmt::fmt)

17
apps/app.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <modern/lib.hpp>
#include <fmt/format.h>
#include <iostream>
#include <vector>
#include <tuple>
int main() {
std::vector<double> input = {1.2, 2.3, 3.4, 4.5};
auto [mean, moment] = accumulate_vector(input);
fmt::print("Mean: {}, Moment: {}\n", mean, moment);
return 0;
}