Skip to content

Commit 0812d05

Browse files
committed
WIP: testing new ci with wrap
1 parent 1402988 commit 0812d05

31 files changed

+514
-107
lines changed

.github/workflows/win-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
branches: ["main"]
88

99

10-
1110
env:
1211
BUILD_TYPE: Release
1312
VCPKG_FILE: c:/vcpkg/scripts/buildsystems/vcpkg.cmake
@@ -19,6 +18,12 @@ jobs:
1918
steps:
2019
- uses: actions/checkout@v4
2120

21+
- name: Setup conda environment
22+
uses: conda-incubator/setup-miniconda@v2
23+
with:
24+
environment-file: environment.yml
25+
activate-environment: diff_check
26+
2227
- name: CMAKE Configure
2328
run: ${{github.workspace}}/cmake/config.bat
2429
- name: CMake Build

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@
9797
"*.inc": "cpp",
9898
"coroutine": "cpp",
9999
"resumable": "cpp",
100-
"*.ipp": "cpp"
100+
"*.ipp": "cpp",
101+
"cinttypes": "cpp",
102+
"codecvt": "cpp",
103+
"csetjmp": "cpp",
104+
"cwctype": "cpp",
105+
"memory_resource": "cpp",
106+
"scoped_allocator": "cpp",
107+
"strstream": "cpp"
101108
}
102109
}

CMakeLists.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,40 @@ target_include_directories(${APP_NAME_EXE}
128128
# pybind11
129129
#--------------------------------------------------------------------------
130130
set(PYBINDMODULE_NAME diffCheckBindings)
131+
set(PYPI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gh/diffCheck/diffCheck)
132+
set(TARGET_DLL_PYPI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gh/diffCheck/diffCheck/dlls)
131133

132134
download_submodule_project(pybind11)
133135
add_subdirectory(deps/pybind11)
134136

137+
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
138+
139+
message(STATUS "Python3_EXECUTABLE: ${Python3_EXECUTABLE}")
140+
message(STATUS "Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}")
141+
message(STATUS "Python3_LIBRARIES: ${Python3_LIBRARIES}")
142+
message(STATUS "Python3_VERSION: ${Python3_VERSION}")
143+
144+
set(PYBIND11_PYTHON_VERSION 3.9.10)
145+
135146
pybind11_add_module(${PYBINDMODULE_NAME} src/diffCheckBindings.cc)
147+
136148
target_link_libraries(${PYBINDMODULE_NAME} PRIVATE ${SHARED_LIB_NAME})
137-
target_include_directories(${PYBINDMODULE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
149+
target_include_directories(${PYBINDMODULE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
150+
151+
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
152+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
153+
$<TARGET_FILE:${PYBINDMODULE_NAME}>
154+
${PYPI_DIR}
155+
)
156+
157+
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
158+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
159+
$<TARGET_FILE:${SHARED_LIB_NAME}>
160+
${TARGET_DLL_PYPI_DIR}
161+
)
162+
# TODO: for open3d-dll is working but it should be done in a more elegant way
163+
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
164+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
165+
$<TARGET_FILE:Open3D::Open3D>
166+
${TARGET_DLL_PYPI_DIR}
167+
)

assets/logo/logo_raw.png

6.5 KB
Loading

cmake/activate_conda.bat

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@echo off
2+
setlocal
3+
4+
REM ########################################################################
5+
REM check if conda is available >
6+
REM check that diff_check environment is available >
7+
REM activate it
8+
REM ########################################################################
9+
10+
REM Check if conda command is available
11+
echo Checking if conda command is available...
12+
where conda >nul 2>nul
13+
if %ERRORLEVEL% equ 0 (
14+
echo Conda command is available.
15+
goto :end
16+
)
17+
if exist "%USERPROFILE%\Anaconda3" (
18+
echo Anaconda3 found in %USERPROFILE%\Anaconda3.
19+
goto :end
20+
)
21+
if exist "%ProgramData%\Anaconda3" (
22+
echo Anaconda3 found in %ProgramData%\Anaconda3.
23+
goto :end
24+
)
25+
if exist "%ProgramFiles%\Anaconda3" (
26+
echo Anaconda3 found in %ProgramFiles%\Anaconda3.
27+
goto :end
28+
)
29+
echo Anaconda3 not found, you won't be able to build the python wrap for diffcheck. Please install it first.
30+
exit /b 1
31+
32+
:end
33+
echo Anaconda3 found.
34+
35+
REM Check if the diff_check environment is available
36+
call conda env list | findstr /C:"diff_check" >nul 2>nul
37+
if %ERRORLEVEL% neq 0 (
38+
echo diff_check environment not found, creating it now...
39+
40+
call conda env create -f environment.yml
41+
if %ERRORLEVEL% neq 0 (
42+
echo Failed to create diff_check environment, please check the environment.yml file.
43+
exit /b 1
44+
)
45+
) else (
46+
echo diff_check environment is available, updating it now...
47+
48+
call conda env update --name diff_check --file environment.yml --prune
49+
if %ERRORLEVEL% neq 0 (
50+
echo Failed to update diff_check environment, please check the environment.yml file.
51+
exit /b 1
52+
)
53+
)
54+
echo diff_check environment is up to date.
55+
56+
REM activate the diff_check environment
57+
call conda activate diff_check
58+
echo diff_check environment activated.

cmake/build.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
@echo off
2+
setlocal
3+
4+
REM activate the conda diff_check environment otherwise the python wrap won't work
5+
call cmake/activate_conda.bat
6+
7+
REM build the project in Release mode
18
cmake --build build --config Release

cmake/clean_config.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
@echo off
2+
setlocal
3+
4+
REM activate the conda diff_check environment otherwise the python wrap won't work
5+
call cmake/activate_conda.bat
6+
7+
REM clean the build directory and reconfigure it
18
rmdir /s /q build
9+
10+
REM configure the project
211
cmake -S . -B build -G "Visual Studio 16 2019" -A x64

cmake/config.bat

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
cmake -S . -B build
1+
@echo off
2+
setlocal
3+
4+
REM activate the conda diff_check environment otherwise the python wrap won't work
5+
call cmake/activate_conda.bat
6+
7+
REM configure the project
8+
cmake -S . -B build -G "Visual Studio 16 2019" -A x64

deps/eigen

Submodule eigen updated from dcceb9a to 0ee5c90

environment.yml

1.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)