From eb8c34f53b09cf9198d3c81c686c5cfe00c82b1b Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Tue, 18 Mar 2025 10:33:51 +0100 Subject: [PATCH] skeleton pyproject.toml --- CMakeLists.txt | 6 +++++- pyproject.toml | 22 ++++++++++++++++++++++ python/CMakeLists.txt | 15 ++++++++++++--- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 pyproject.toml diff --git a/CMakeLists.txt b/CMakeLists.txt index 5676ec92d..c15f1fcb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-3.0-or-other # Copyright (C) 2021 Contributors to the SLS Detector Package -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.15) project(slsDetectorPackage) # Read VERSION file into project version @@ -29,6 +29,10 @@ include(FetchContent) option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF) option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF) +if(${SKBUILD}) + message(STATUS "Building with scikit-build") +endif() + if(SLS_FETCH_ZMQ_FROM_GITHUB) # Opt in to pull down a zmq version from github instead of # using the bundled verison diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..e626be8c0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["scikit-build-core>=0.10", "pybind11", "numpy"] +build-backend = "scikit_build_core.build" + +[project] +name = "slsDetectorPackage" +version = "2025.2.18" + + +[tool.scikit-build] +cmake.verbose = true +cmake.build-type = "Release" +install.components = ["python"] + + +[tool.scikit-build.cmake.define] +SLS_USE_RECEIVER = "OFF" +SLS_USE_RECEIVER_BINARIES = "OFF" +SLS_USE_TEXTCLIENT = "OFF" +SLS_USE_PYTHON = "ON" +SLS_INSTALL_PYTHONEXT = "ON" +SLS_BUILD_SHARED_LIBRARIES = "OFF" \ No newline at end of file diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 0ae86941f..80a107ff4 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -72,9 +72,18 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../VERSION if(SLS_INSTALL_PYTHONEXT) install(TARGETS _slsdet EXPORT "${TARGETS_EXPORT_NAME}" - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/python + LIBRARY DESTINATION slsdet + COMPONENT python ) + install( + FILES ${PYTHON_FILES} + DESTINATION slsdet + COMPONENT python + ) + install( + FILES ../VERSION + DESTINATION slsdet + COMPONENT python + ) - install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet) - install(FILES ../VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet) endif() \ No newline at end of file