Skip to content

Commit 0b2f817

Browse files
committed
fixed win
1 parent f9c6a16 commit 0b2f817

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
__pycache__/
1515
test_package/__pycache__/
1616
test_package/build/
17+
**/test_cmakedeps/conan.lock
18+
**/test_cmakedeps/conanbuildinfo.txt
19+
**/test_cmakedeps/conaninfo.txt
20+
**/test_cmakedeps/graph_info.json
1721
build/
1822
*.pyc
1923
*.py[cod]

recipes/pybind11/all/test_cmakedeps/conanfile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from conans import ConanFile
2-
from conan.tools.cmake import CMake, CMakeToolchain
2+
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
33
from conan.tools.env import Environment
44
from conan.tools.cross_building import cross_building
55
import os
@@ -12,9 +12,12 @@ class TestPackageConan(ConanFile):
1212

1313
def generate(self):
1414
toolchain = CMakeToolchain(self)
15-
toolchain.variables["PYTHON_EXECUTABLE"] = self._python_interpreter
15+
toolchain.variables["PYTHON_EXECUTABLE"] = self._python_interpreter.replace("\\", "/")
1616
toolchain.generate()
1717

18+
def layout(self):
19+
cmake_layout(self)
20+
1821
def build(self):
1922
cmake = CMake(self)
2023
cmake.configure()
@@ -29,7 +32,7 @@ def _python_interpreter(self):
2932
def test(self):
3033
if not cross_building(self):
3134
env = Environment()
32-
env.define("PYTHONPATH", os.getcwd())
35+
env.define("PYTHONPATH", self.cpp.build.libdirs[0])
3336
env.vars(self).save_script("launcher")
3437
test_path = os.path.join(self.source_folder, "test.py")
3538
self.run("{} {}".format(self._python_interpreter, test_path), env="launcher")

0 commit comments

Comments
 (0)