Skip to content

Commit

Permalink
FindPython3 -> FindPython
Browse files Browse the repository at this point in the history
this allows to unify python discovery across the stack (instead of using a mix of PythonInterp, Python3, and Python)
  • Loading branch information
evaleev committed Dec 20, 2023
1 parent d108709 commit c0c4ea5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.11.0)
cmake_minimum_required (VERSION 3.12.0) # for FindPython

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
Expand Down
8 changes: 4 additions & 4 deletions src/madness/tensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# src/madness/tensor

# Add targets for generated header files
find_package(Python3)
if(Python3_Interpreter_FOUND)
find_package(Python COMPONENTS Interpreter)
if(TARGET Python::Interpreter)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tensoriter_spec.h
${CMAKE_CURRENT_SOURCE_DIR}/tensor_spec.h
COMMAND ${Python3_EXECUTABLE} tempspec.py
COMMAND ${Python_EXECUTABLE} tempspec.py
MAIN_DEPENDENCY tempspec.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating tensoriter_spec.h and tensor_spec.h")
elseif(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tensoriter_spec.h.h
OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tensor_spec.h)
message(FATAL_ERROR "PYTHON executable is not available to generate required source files")
message(FATAL_ERROR "Python executable is not available to generate required source files")
endif()

# Source lists for MADtensor
Expand Down

0 comments on commit c0c4ea5

Please sign in to comment.