Skip to content

Commit

Permalink
fixed win
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Feb 14, 2022
1 parent f9c6a16 commit 0b2f817
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
__pycache__/
test_package/__pycache__/
test_package/build/
**/test_cmakedeps/conan.lock
**/test_cmakedeps/conanbuildinfo.txt
**/test_cmakedeps/conaninfo.txt
**/test_cmakedeps/graph_info.json
build/
*.pyc
*.py[cod]
Expand Down
9 changes: 6 additions & 3 deletions recipes/pybind11/all/test_cmakedeps/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conans import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.env import Environment
from conan.tools.cross_building import cross_building
import os
Expand All @@ -12,9 +12,12 @@ class TestPackageConan(ConanFile):

def generate(self):
toolchain = CMakeToolchain(self)
toolchain.variables["PYTHON_EXECUTABLE"] = self._python_interpreter
toolchain.variables["PYTHON_EXECUTABLE"] = self._python_interpreter.replace("\\", "/")
toolchain.generate()

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
Expand All @@ -29,7 +32,7 @@ def _python_interpreter(self):
def test(self):
if not cross_building(self):
env = Environment()
env.define("PYTHONPATH", os.getcwd())
env.define("PYTHONPATH", self.cpp.build.libdirs[0])
env.vars(self).save_script("launcher")
test_path = os.path.join(self.source_folder, "test.py")
self.run("{} {}".format(self._python_interpreter, test_path), env="launcher")

0 comments on commit 0b2f817

Please sign in to comment.