1- #
2- # Copyright 2020 Adobe. All rights reserved.
3- # This file is licensed to you under the Apache License, Version 2.0 (the "License");
4- # you may not use this file except in compliance with the License. You may obtain a copy
5- # of the License at http://www.apache.org/licenses/LICENSE-2.0
6- #
7- # Unless required by applicable law or agreed to in writing, software distributed under
8- # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9- # OF ANY KIND, either express or implied. See the License for the specific language
10- # governing permissions and limitations under the License.
11- #
1+ # pybind11 (https://github.com/pybind/pybind11)
2+ # License: BSD-style
123if (TARGET pybind11::pybind11)
134 return ()
145endif ()
156
167message (STATUS "Third-party: creating target 'pybind11::pybind11'" )
178
18- include (FetchContent)
19- FetchContent_Declare(
20- pybind11
21- GIT_REPOSITORY https://github.com/pybind/pybind11.git
22- GIT_TAG v2.9.2
23- GIT_SHALLOW FALSE
24- )
25-
269if (POLICY CMP0094) # https://cmake.org/cmake/help/latest/policy/CMP0094.html
2710 cmake_policy (SET CMP0094 NEW) # FindPython should return the first matching Python
2811endif ()
@@ -39,7 +22,8 @@ endif ()
3922# Pybind11 still uses the deprecated FindPythonInterp. So let's call CMake's
4023# new FindPython module and set PYTHON_EXECUTABLE for Pybind11 to pick up.
4124# This works well with conda environments.
42- find_package (Python REQUIRED COMPONENTS Interpreter Development)
25+ find_package (Python COMPONENTS Interpreter Development.Module REQUIRED )
4326set (PYTHON_EXECUTABLE ${Python_EXECUTABLE} )
4427
45- FetchContent_MakeAvailable(pybind11)
28+ include (CPM)
29+ CPMAddPackage("gh:pybind/pybind11@2.9.2" )
0 commit comments