Skip to content

Commit

Permalink
Move Python examples to repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
BUYT-1 committed Nov 3, 2023
1 parent 8ebb2e2 commit 49984b8
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(Desbordante)

option(COMPILE_PYBIND "Build the python bindings" OFF)
option(COPY_PYTHON_EXAMPLES "Copy Python examples" OFF)
option(COMPILE_TESTS "Build tests" ON)
option(UNPACK_DATASETS "Unpack datasets" ON)
option(ASAN "Enable sanitizer" ON)
Expand Down Expand Up @@ -81,3 +82,6 @@ add_subdirectory("cfg")
if (COMPILE_PYBIND)
add_subdirectory("src/python_bindings")
endif()
if (COPY_PYTHON_EXAMPLES)
add_subdirectory("examples")
endif()
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if [[ $PYBIND == true ]]; then
if [[ ! -d "pybind11" ]] ; then
git clone https://github.com/pybind/pybind11.git --branch v2.10 --depth 1
fi
PREFIX="$PREFIX -D COMPILE_PYBIND=ON"
PREFIX="$PREFIX -D COMPILE_PYBIND=ON -D COPY_PYTHON_EXAMPLES=ON"
fi

if [[ $DEBUG_MODE != true ]]; then
Expand Down
18 changes: 18 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
add_custom_target(copy-python-examples ALL)
add_custom_command(TARGET copy-python-examples
COMMAND ${CMAKE_COMMAND} -E
make_directory ${CMAKE_BINARY_DIR}/examples
${CMAKE_BINARY_DIR}/examples/datasets
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/examples/dedupe.py
${CMAKE_SOURCE_DIR}/examples/mine_typos.py
${CMAKE_SOURCE_DIR}/examples/anomaly_detection.py
${CMAKE_BINARY_DIR}/examples
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/examples/datasets/duplicates.csv
${CMAKE_SOURCE_DIR}/examples/datasets/Workshop.csv
${CMAKE_SOURCE_DIR}/examples/datasets/cargo_data_1.csv
${CMAKE_SOURCE_DIR}/examples/datasets/cargo_data_2.csv
${CMAKE_SOURCE_DIR}/examples/datasets/cargo_data_3.csv
${CMAKE_BINARY_DIR}/examples/datasets
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions src/python_bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,3 @@ add_custom_command(TARGET ${BINDINGS_NAME}
${CMAKE_SOURCE_DIR}/test_input_data/WDC_satellites.csv
${CMAKE_BINARY_DIR}/src/python_bindings/
)

add_custom_target(copy-python-examples ALL)
add_custom_command(TARGET copy-python-examples
COMMAND ${CMAKE_COMMAND} -E
make_directory ${CMAKE_BINARY_DIR}/src/python_bindings/examples
${CMAKE_BINARY_DIR}/src/python_bindings/examples/datasets
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/src/python_bindings/examples/dedupe.py
${CMAKE_SOURCE_DIR}/src/python_bindings/examples/mine_typos.py
${CMAKE_BINARY_DIR}/src/python_bindings/examples
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/src/python_bindings/examples/datasets/duplicates.csv
${CMAKE_SOURCE_DIR}/test_input_data/Workshop.csv
${CMAKE_BINARY_DIR}/src/python_bindings/examples/datasets
)

0 comments on commit 49984b8

Please sign in to comment.