-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
729ca2e
commit 552912d
Showing
5 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 7922631..89d3cb2 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,4 +1,4 @@ | ||
-cmake_minimum_required(VERSION 3.1..3.19) | ||
+cmake_minimum_required(VERSION 3.18..3.20) | ||
|
||
# Basic settings | ||
# ============== | ||
@@ -92,16 +92,16 @@ endif() | ||
# Python API | ||
|
||
if(BUILD_PYTHON OR BUILD_ALL) | ||
- find_package(pybind11 CONFIG REQUIRED) | ||
+ find_package(Python REQUIRED COMPONENTS Interpreter Development NumPy) | ||
+ find_package(pybind11 REQUIRED CONFIG) | ||
find_package(xtensor-python REQUIRED) | ||
- find_package(Python REQUIRED COMPONENTS NumPy) | ||
|
||
- pybind11_add_module(python python/main.cpp) | ||
- set_target_properties(python PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) | ||
- target_link_libraries(python PUBLIC ${PROJECT_NAME} | ||
+ pybind11_add_module(mypymod python/main.cpp) | ||
+ set_target_properties(mypymod PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) | ||
+ target_link_libraries(mypymod PUBLIC ${PROJECT_NAME} | ||
pybind11::module xtensor-python Python::NumPy prrng::use_boost) | ||
|
||
- target_compile_definitions(python PRIVATE VERSION_INFO=${PROJECT_VERSION}) | ||
+ target_compile_definitions(mypymod PRIVATE VERSION_INFO=${PROJECT_VERSION}) | ||
endif() | ||
|
||
# Documentation | ||
diff --git a/setup.py b/setup.py | ||
index fbb4b5c..604e7dc 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -48,7 +48,7 @@ class CMakeBuild(build_ext): | ||
cmake_args = [ | ||
"-DBUILD_PYTHON=1", | ||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir), | ||
- "-DPYTHON_EXECUTABLE={}".format(sys.executable), | ||
+ "-DPython_EXECUTABLE={}".format(sys.executable), | ||
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm | ||
] | ||
build_args = [] |