Skip to content

Commit b5a67be

Browse files
committed
shuffle things
1 parent ae9dd53 commit b5a67be

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/wheels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: conan config install .github/config/${{ matrix.os }}/conan
4343
- uses: pypa/cibuildwheel@v2.17
4444
env:
45-
MACOSX_DEPLOYMENT_TARGET: 10.14
45+
MACOSX_DEPLOYMENT_TARGET: 10.15
4646
CIBW_ARCHS_MACOS: auto universal2
4747
CIBW_SKIP: "*-win32 *-manylinux_i686"
4848
- name: Verify clean directory

setup.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,19 @@ def conan_install(self, source_dir: Path, build_dir: Path) -> None:
6060
check=True,
6161
)
6262

63-
def cmake_configure(self, source_dir: Path, build_dir: Path, ext_dir: Path) -> None:
63+
def cmake_configure(self, source_dir: Path, build_dir: Path, install_dir: Path) -> None:
6464
subprocess.run(
6565
[
6666
"cmake",
6767
"-S",
6868
str(source_dir),
6969
"-B",
7070
str(build_dir),
71-
f"-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake",
72-
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={str(ext_dir)}{os.sep}",
71+
"-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake",
72+
f"-DCMAKE_INSTALL_PREFIX={str(install_dir)}",
73+
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={str(install_dir)}",
74+
"-DCMAKE_BUILD_TYPE=Release",
7375
f"-DPYTHON_EXECUTABLE={sys.executable}",
74-
f"-DCMAKE_BUILD_TYPE=Release",
7576
],
7677
check=True,
7778
)
@@ -103,20 +104,27 @@ def cmake_install(self, build_dir: Path) -> None:
103104
def build_extension(self, ext: CMakeExtension) -> None:
104105
source_dir = Path(ext.source_dir)
105106

106-
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name)
107-
ext_dir = ext_fullpath.parent.resolve()
108-
109107
build_temp = Path(self.build_temp) / ext.name
110108
build_temp.mkdir(parents=True, exist_ok=True)
111109

110+
ext_fullpath = Path(self.get_ext_fullpath(ext.name))
111+
install_dir = ext_fullpath.parent
112+
112113
self.conan_profile()
113114
self.conan_remote()
114115
self.conan_install(source_dir, build_temp)
115116

116-
self.cmake_configure(source_dir, build_temp, ext_dir)
117+
self.cmake_configure(source_dir, build_temp, install_dir)
117118
self.cmake_build(build_temp)
118119
self.cmake_install(build_temp)
119120

121+
# list build directory for debugging purposes
122+
print(f"Build directory: {build_temp}")
123+
subprocess.run(["ls", "-la", str(build_temp)], check=True)
124+
125+
print(f"Install directory: {install_dir}")
126+
subprocess.run(["ls", "-la", str(install_dir)], check=True)
127+
120128

121129
setup(
122130
name="pyodr",

src/cpp/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ find_package(pybind11 REQUIRED)
1010

1111
pybind11_add_module(pyodr pyodr.cpp)
1212
target_link_libraries(pyodr PRIVATE odrcore::odrcore)
13+
14+
install(
15+
TARGETS pyodr
16+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
17+
)

0 commit comments

Comments
 (0)