Skip to content

Commit 8f51d29

Browse files
committed
Update Example C++ Usage
1 parent 82925ec commit 8f51d29

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

examples/conan_cmake/library/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ install-path = "install"
1818
dependencies = ["fmt>=12.1.0"]
1919

2020

21+
[tool.cppython.generators.cmake]
22+
2123
[tool.cppython.providers.conan]
2224

2325
[tool.pdm]

examples/conan_cmake/library/src/mathutils.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace mathutils
5252
void print_result(const char *operation, double a, double b, double result)
5353
{
5454
fmt::print(fg(fmt::terminal_color::green),
55-
"MathUtils {}: {} + {} = {}\n",
55+
"MathUtils {}: ({}, {}) = {}\n",
5656
operation, a, b, result);
5757
}
5858
}

examples/conan_cmake/library/test_package/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import std;
33

44
int main()
55
{
6-
// Test the mathutils library
76
std::cout << "Testing MathUtils library..." << std::endl;
87

9-
double result1 = mathutils::add(5.0, 3.0);
10-
double result2 = mathutils::multiply(4.0, 2.5);
8+
std::cout << "add(5, 3) = " << mathutils::add(5.0, 3.0) << std::endl;
9+
std::cout << "multiply(4, 2.5) = " << mathutils::multiply(4.0, 2.5) << std::endl;
1110

1211
std::cout << "MathUtils tests completed successfully!" << std::endl;
1312
return 0;

0 commit comments

Comments
 (0)