Skip to content

Commit

Permalink
build: fix library/binary output path
Browse files Browse the repository at this point in the history
  • Loading branch information
jnooree committed Mar 7, 2024
1 parent bb42d22 commit 2d80010
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions pyproject.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cmake.verbose = @NURI_VERBOSE_CMAKE@

sdist.exclude = ["*.h", "*.cpp", "*.in", "*.so"]
wheel.packages = ["python/src/nuri"]
wheel.install-dir = "nuri"

[tool.scikit-build.cmake.define]
NURI_BUILD_PYTHON = "ON"
Expand Down
14 changes: 7 additions & 7 deletions python/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# SPDX-License-Identifier: Apache-2.0
#

function(nuri_python_add_module name directory)
function(nuri_python_add_module name subdir)
set(target_name "nuri_python${name}")

file(RELATIVE_PATH dir_inv
"${CMAKE_CURRENT_LIST_DIR}/${directory}"
"${CMAKE_CURRENT_LIST_DIR}/")
"${CMAKE_CURRENT_LIST_DIR}/nuri/${subdir}"
"${CMAKE_CURRENT_LIST_DIR}/nuri/")

pybind11_add_module("${target_name}" OPT_SIZE "${ARGN}")
target_link_libraries("${target_name}" PRIVATE nuri_lib)
Expand All @@ -23,23 +23,23 @@ function(nuri_python_add_module name directory)
if(NOT SKBUILD)
set_target_properties("${target_name}"
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${directory}")
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/nuri/${subdir}")
endif()

install(TARGETS "${target_name}"
LIBRARY
DESTINATION "./${directory}")
DESTINATION "./${subdir}")

add_dependencies(nuri_python "${target_name}")
endfunction()

add_custom_target(nuri_python)
add_dependencies(nuri_python nuri_lib)

nuri_python_add_module(_log_interface "nuri" "nuri/_log_interface.cpp")
nuri_python_add_module(_log_interface "" "nuri/_log_interface.cpp")
target_link_libraries(nuri_python_log_interface PRIVATE absl::log_initialize)

nuri_python_add_module(_core "nuri/core"
nuri_python_add_module(_core "core"
nuri/core/_core.cpp
nuri/core/containers.cpp
nuri/core/element.cpp
Expand Down

0 comments on commit 2d80010

Please sign in to comment.