Skip to content

Commit 1752b17

Browse files
committed
MILESTONE: functioning pipeline for pipenv + refined cmake for copying dlls
1 parent 8cfb4cc commit 1752b17

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

CMakeLists.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,22 @@ if (BUILD_PYTHON_MODULE)
149149
target_link_libraries(${PYBINDMODULE_NAME} PRIVATE ${SHARED_LIB_NAME})
150150
target_include_directories(${PYBINDMODULE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
151151

152+
# copy the pyd file to the pypi directory
152153
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
153154
COMMAND ${CMAKE_COMMAND} -E copy_if_different
154155
$<TARGET_FILE:${PYBINDMODULE_NAME}>
155156
${PYPI_DIR}
156157
)
157158

158-
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
159-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
160-
$<TARGET_FILE:${SHARED_LIB_NAME}>
161-
${TARGET_DLL_PYPI_DIR}
162-
)
163-
# TODO: for open3d-dll is working but it should be done in a more elegant way
164-
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
165-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
166-
$<TARGET_FILE:Open3D::Open3D>
167-
${TARGET_DLL_PYPI_DIR}
168-
)
159+
# get all the files -dlls in the bin directory and copy them one by one to the pypi directory
160+
file(GLOB files ${CMAKE_BINARY_DIR}/bin/Release/*.dll)
161+
foreach(file ${files})
162+
message(STATUS "Copying ${file} to ${TARGET_DLL_PYPI_DIR}")
163+
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
164+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
165+
${file}
166+
${TARGET_DLL_PYPI_DIR}
167+
)
168+
endforeach()
169+
169170
endif()

cmake/__noenv__clean_config.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ REM clean the build directory and reconfigure it
55
rmdir /s /q build
66

77
REM configure the project
8-
cmake -S . -B build
8+
cmake -S . -B build -A x64

deps/eigen

Submodule eigen updated from 0ee5c90 to c1d6374

0 commit comments

Comments
 (0)