Skip to content

Commit

Permalink
link against Python3_LIBRARIES
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Apr 15, 2024
1 parent 1dbedc3 commit 849b57c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ option(WITH_TESTS "Enable tests" OFF)
set(Python3_FIND_STRATEGY "LOCATION")
set(Python3_FIND_REGISTRY "LAST")
set(Python3_FIND_FRAMEWORK "LAST")
find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development.Module Development.Embed NumPy REQUIRED)


# find PDAL. Require 2.1+
find_package(PDAL 2.6 REQUIRED)
Expand Down Expand Up @@ -96,7 +97,7 @@ macro(PDAL_PYTHON_ADD_PLUGIN _name _type _shortname)
)
target_link_options(${${_name}} BEFORE PRIVATE ${PDAL_PYTHON_ADD_PLUGIN_COMPILE_OPTIONS})
target_compile_definitions(${${_name}} PRIVATE
PDAL_PYTHON_LIBRARY="${PYTHON_LIBRARY}" PDAL_DLL_EXPORT)
PDAL_PYTHON_LIBRARY="${Python3_LIBRARIES}" PDAL_DLL_EXPORT)
target_compile_definitions(${${_name}} PRIVATE PDAL_DLL_EXPORT)
if (PDAL_PYTHON_ADD_PLUGIN_SYSTEM_INCLUDES)
target_include_directories(${${_name}} SYSTEM PRIVATE
Expand Down Expand Up @@ -141,7 +142,7 @@ macro(PDAL_PYTHON_ADD_TEST _name)
${WINSOCK_LIBRARY}
)
target_compile_definitions(${_name} PRIVATE
PDAL_PYTHON_LIBRARY="${PYTHON_LIBRARY}")
PDAL_PYTHON_LIBRARY="${Python3_LIBRARIES}")
add_test(NAME ${_name}
COMMAND
"${PROJECT_BINARY_DIR}/bin/${_name}"
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ changelog = "https://github.com/PDAL/python-plugins/blob/main/README.rst"
requires = ["scikit-build-core", "numpy", "pybind11[global]"]
build-backend = "scikit_build_core.build"

#[tool.scikit-build-core]
#wheel.py-api = "cp12"
#wheel.cmake = true


[tool.scikit-build]
build-dir = "build/{wheel_tag}"
Expand Down

0 comments on commit 849b57c

Please sign in to comment.