Skip to content

Commit

Permalink
cmake : alias some targets to Python::*
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Aug 20, 2024
1 parent ddcf36a commit d0ed83e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
if(UNIX)
set(PYTHON_COMPONENTS Development.Module)
set(PYTHON_COMPONENTS Interpreter Development.Module)
endif()

include(${JRL_CMAKE_MODULES}/python.cmake)
include(${JRL_CMAKE_MODULES}/python-helpers.cmake)

option(GENERATE_PYTHON_STUBS "Generate Python stubs" OFF)

findpython(REQUIRED Development.Module)
set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
findpython(REQUIRED)
set(Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
# Nanobind expects these targets instead of Python3::*
# https://github.com/jrl-umi3218/jrl-cmakemodules/issues/708
add_library(Python::Module ALIAS Python3::Module)
add_executable(Python::Interpreter ALIAS Python3::Interpreter)

if(IS_ABSOLUTE ${PYTHON_SITELIB})
set(${PYWRAP}_INSTALL_DIR ${PYTHON_SITELIB}/${PROJECT_NAME})
Expand Down

0 comments on commit d0ed83e

Please sign in to comment.