Skip to content

Commit 57cf5e8

Browse files
committed
Add New Test Data
1 parent 88edc6a commit 57cf5e8

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.24)
2+
3+
project(FormatOutput LANGUAGES CXX C)
4+
5+
set(CMAKE_CXX_STANDARD 14)
6+
7+
find_package(fmt REQUIRED)
8+
9+
add_executable(main main.cpp)
10+
target_link_libraries(main PRIVATE fmt::fmt)
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Preexisting CMake project with Conan integration."""
2+
3+
from conan import ConanFile # type: ignore
4+
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout # type: ignore
5+
6+
7+
class MyProject(ConanFile): # type: ignore
8+
"""Conan file for a simple CMake project."""
9+
10+
name = 'myproject'
11+
version = '1.0'
12+
settings = 'os', 'compiler', 'build_type', 'arch'
13+
generators = 'CMakeDeps'
14+
15+
def layout(self) -> None:
16+
"""Define the layout of the project."""
17+
cmake_layout(self)
18+
19+
def generate(self) -> None:
20+
"""Generate the CMake toolchain file."""
21+
tc = CMakeToolchain(self)
22+
tc.generate()
23+
24+
def build(self) -> None:
25+
"""Build the project using CMake."""
26+
cmake = CMake(self)
27+
cmake.configure()
28+
cmake.build()

examples/conan_cmake/inject/main.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "fmt/color.h"
2+
3+
int main()
4+
{
5+
fmt::print(fg(fmt::terminal_color::cyan), "Hello fmt {}!\n", FMT_VERSION);
6+
return 0;
7+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
description = "A simple project showing how to use conan with CPPython"
3+
name = "cppython-conan-cmake-simple"
4+
version = "1.0.0"
5+
6+
license = {text = "MIT"}
7+
8+
authors = [{name = "Synodic Software", email = "[email protected]"}]
9+
10+
requires-python = ">=3.13"
11+
12+
dependencies = ["cppython[conan, cmake]>=0.1.0"]
13+
14+
[tool.cppython]
15+
generator-name = "cmake"
16+
provider-name = "conan"
17+
18+
install-path = "install"
19+
20+
dependencies = ["fmt>=11.0.1"]
21+
22+
[tool.cppython.generator]
23+
24+
[tool.cppython.provider]
25+
26+
[tool.pdm]
27+
distribution = false

0 commit comments

Comments
 (0)