Skip to content

Commit

Permalink
Feature/external content (#63)
Browse files Browse the repository at this point in the history
* Support out-of-source build

* (minor) update CMakeLists.txt files

* Generalize version of tar.gz target

* (minor) remove line and bump up the python version
  • Loading branch information
LimHyungTae authored Dec 6, 2024
1 parent af121f5 commit 9c97f17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.11)
project(patchworkpp VERSION 1.0.0)
project(patchworkpp VERSION 1.0.1)

set(CMAKE_CXX_STANDARD 20)
set(PYTHON_EXECUTABLE python3)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Open3D_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Open3D_CXX_FLAGS}")
Expand Down Expand Up @@ -58,5 +59,4 @@ if (INCLUDE_CPP_EXAMPLES)
target_link_libraries(demo_sequential PRIVATE ${PARENT_PROJECT_NAME}::${TARGET_NAME} ${Open3D_LIBRARIES} "stdc++fs")
target_include_directories(demo_sequential PUBLIC ${Open3D_INCLUDE_DIRS})
set_target_properties(demo_sequential PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples")

endif()
endif()
12 changes: 10 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ set(TARGET_NAME ground_seg_cores)
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
find_package(pybind11 CONFIG REQUIRED)

# See our `pyproject.toml` file. We use `scikit_build_core`, which turns on `SKBUILD`
if (DEFINED SKBUILD)
message(STATUS "Building with Scikit-Build")
endif ()

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cpp ${CMAKE_CURRENT_BINARY_DIR}/patchworkpp_cpp)
else()
cmake_minimum_required(VERSION 3.18)
message(STATUS "Performing out-of-tree build, fetching Patchwork++ v${CMAKE_PROJECT_VERSION} Release from Github")
include(FetchContent)
# Currently, out-of-source build is not supported.
# But, it will be updated soon!
FetchContent_Declare(
ext_ground_seg_cores PREFIX ${PARENT_PROJECT_NAME}
URL https://github.com/url-kaist/patchwork-plusplus/archive/refs/tags/v${CMAKE_PROJECT_VERSION}.tar.gz SOURCE_SUBDIR
cpp/patchworkpp)
FetchContent_MakeAvailable(ext_ground_seg_cores)
endif()

pybind11_add_module(pypatchworkpp patchworkpp/pybinding.cpp)
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "pypatchworkpp"
version = "0.1.0"
version = "1.0.1"
requires-python = ">=3.8"
description = "ground segmentation"
dependencies = [
Expand Down

0 comments on commit 9c97f17

Please sign in to comment.