Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CPython 3.12.2 #17

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from conan.tools.files import copy, mkdir, AutoPackager, update_conandata
from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc
from conan.tools.scm import Version
from jinja2 import Template


required_conan_version = ">=1.58.0 <2.0.0"
Expand Down Expand Up @@ -103,8 +102,8 @@ def requirements(self):
if self.options.with_apps:
self.requires("docopt.cpp/0.6.3")
if self.options.with_python_bindings:
self.requires("cpython/3.10.4@ultimaker/stable")
self.requires("pybind11/2.10.4")
self.requires("cpython/3.12.2@ultimaker/cura_11079")
self.requires("pybind11/2.11.1")

def build_requirements(self):
self.test_requires("standardprojectsettings/[>=0.1.0]@ultimaker/stable")
Expand Down Expand Up @@ -136,13 +135,15 @@ def generate(self):

tc.variables["WITH_PYTHON_BINDINGS"] = self.options.with_python_bindings
if self.options.with_python_bindings:
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0148"] = "OLD"
tc.variables["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python.replace("\\", "/")
tc.variables["Python_USE_STATIC_LIBS"] = not self.options["cpython"].shared
tc.variables["Python_ROOT_DIR"] = self.deps_cpp_info["cpython"].rootpath.replace("\\", "/")
tc.variables["Python_ROOT_DIR"] = self.deps_user_info["cpython"].pythonhome.replace("\\", "/")
tc.variables["Python_FIND_FRAMEWORK"] = "NEVER"
tc.variables["Python_FIND_REGISTRY"] = "NEVER"
tc.variables["Python_FIND_IMPLEMENTATIONS"] = "CPython"
tc.variables["Python_FIND_STRATEGY"] = "LOCATION"

tc.variables["PYDULCIFICUM_VERSION"] = self.version

if is_msvc(self):
Expand Down
15 changes: 8 additions & 7 deletions pyDulcificum/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
find_package(pybind11 REQUIRED)
set(ENV{LD_LIBRARY_PATH} "${CMAKE_LIBRARY_PATH}:${LD_LIBRARY_PATH}") # Needed to ensure that CMake finds the Conan CPython library
find_package(pybind11 REQUIRED)

pybind11_add_module(pyDulcificum pyDulcificum.cpp)
target_link_libraries(pyDulcificum PUBLIC dulcificum pybind11::pybind11)
target_compile_definitions(pyDulcificum PRIVATE PYDULCIFICUM_VERSION="${PYDULCIFICUM_VERSION}")
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
pybind11_strip(pyDulcificum)
endif()
pybind11_add_module(pyDulcificum pyDulcificum.cpp)
target_link_libraries(pyDulcificum PUBLIC dulcificum pybind11::pybind11)
target_compile_definitions(pyDulcificum PRIVATE PYDULCIFICUM_VERSION="${PYDULCIFICUM_VERSION}")
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
pybind11_strip(pyDulcificum)
endif()
Loading