Skip to content

Commit 630efc9

Browse files
authored
fixes regarding cpythob (#54)
1 parent 48d6bad commit 630efc9

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

examples/basic-nanobind/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.15)
22
project(myadder_nanobind LANGUAGES CXX)
33

4-
find_package(Python COMPONENTS Interpreter Development REQUIRED)
4+
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
55

66
find_package(nanobind CONFIG REQUIRED)
77
find_package(fmt REQUIRED)

recipes/cpython/conanfile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def package(self):
3636
copy(self, "*", src=os.path.join(self.build_folder, "python"), dst=self.package_folder)
3737

3838
def package_info(self):
39-
self.cpp_info.includedirs = ["include"]
39+
# this package is intended for using as application
40+
self.cpp_info.includedirs = []
4041
self.cpp_info.libdirs = ["lib"]
4142

4243
if self.settings.os == "Windows":
@@ -52,6 +53,6 @@ def package_info(self):
5253
if python_exe.exists():
5354
python_root = python_exe.parent.parent if python_exe.parent.name == "bin" else python_exe.parent
5455
python_root_str = str(python_root)
55-
self.runenv_info.define("Python3_ROOT", python_root_str)
56-
self.buildenv_info.define("Python3_ROOT", python_root_str)
5756
self.buildenv_info.define("Python3_ROOT_DIR", python_root_str)
57+
# Otherwise an active venv/conda would outrank Python3_ROOT_DIR.
58+
self.buildenv_info.define("Python3_FIND_VIRTUALENV", "STANDARD")

recipes/cpython/test_package/conanfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class TestPackageConan(ConanFile):
88
settings = "os", "arch"
9-
generators = "VirtualRunEnv"
109

1110
def requirements(self):
1211
self.requires(self.tested_reference_str)

0 commit comments

Comments
 (0)