|
1 | | -cmake_minimum_required(VERSION 3.15...3.29) |
| 1 | +cmake_minimum_required(VERSION 3.15...3.27) |
2 | 2 | project(mapbox_earcut LANGUAGES CXX) |
3 | 3 |
|
4 | | -if (NOT SKBUILD) |
5 | | - message(WARNING "\ |
6 | | - This CMake file is meant to be executed using 'scikit-build-core'. |
7 | | - Running it directly will almost certainly not produce the desired |
8 | | - result. If you are a user trying to install this package, use the |
9 | | - command below, which will install all necessary build dependencies, |
10 | | - compile the package in an isolated environment, and then install it. |
11 | | - ===================================================================== |
12 | | - $ uv sync |
13 | | - ===================================================================== |
14 | | - If you are a software developer, and this is your own package, then |
15 | | - it is usually much more efficient to install the build dependencies |
16 | | - in your environment once and use the following command that avoids |
17 | | - a costly creation of a new virtual environment at every compilation: |
18 | | - ===================================================================== |
19 | | - $ uv build |
20 | | - ===================================================================== |
21 | | - You may optionally add -Ceditable.rebuild=true to auto-rebuild when |
22 | | - the package is imported. Otherwise, you need to rerun the above |
23 | | - after editing C++ files.") |
| 4 | +if(CMAKE_VERSION VERSION_LESS 3.18) |
| 5 | + set(DEV_MODULE Development) |
| 6 | +else() |
| 7 | + set(DEV_MODULE Development.Module) |
24 | 8 | endif() |
25 | 9 |
|
26 | | -find_package(Python COMPONENTS Interpreter Development |
27 | | - REQUIRED) |
| 10 | +find_package(Python COMPONENTS Interpreter ${DEV_MODULE} REQUIRED) |
28 | 11 | execute_process( |
29 | 12 | COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir |
30 | 13 | OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE nanobind_ROOT) |
|
0 commit comments