blob: 116bada15f66bd5d80be19946e64cbf66d0245ed [file] [log] [blame] [edit]
--- audaspace-1.3.0/CMakeLists.txt.orig 2021-03-31 12:48:16.378256600 +0300
+++ audaspace-1.3.0/CMakeLists.txt 2021-03-31 12:55:01.138433600 +0300
@@ -657,16 +657,15 @@
# Python
if(WITH_PYTHON)
- find_package(PythonLibs 3.2 ${PACKAGE_OPTION})
+ find_package(Python3 COMPONENTS Interpreter Development)
find_package(NumPy ${PACKAGE_OPTION})
- if(PYTHONLIBS_FOUND AND NUMPY_FOUND)
+ if(Python3_LIBRARIES AND NUMPY_FOUND)
list(APPEND INCLUDE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS})
if(WITH_PYTHON_MODULE)
- find_package(PythonInterp 3.2 ${PACKAGE_OPTION})
- if(NOT PYTHONINTERP_FOUND)
+ if(NOT Python3_Interpreter_FOUND)
set(WITH_PYTHON_MODULE FALSE)
message(WARNING "Python interpreter not found, module will not be built.")
endif()
@@ -674,10 +673,6 @@
set(AUDASPACE_PY_LIBRARY -laudaspace-py)
- if(WIN32)
- file(GLOB PYTHON_DLLS ${LIBRARY_PATH}/Python/bin/*.dll)
- list(APPEND DLLS ${PYTHON_DLLS})
- endif()
else()
set(WITH_PYTHON FALSE CACHE BOOL "Build With Python Library" FORCE)
message(WARNING "Python libraries not found, language binding will not be built.")
@@ -1044,7 +1039,7 @@
endif()
add_library(audaspace-py ${LIBRARY_TYPE} ${PYTHON_SRC} ${PYTHON_HDR})
- target_link_libraries(audaspace-py audaspace ${PYTHON_LIBRARIES})
+ target_link_libraries(audaspace-py audaspace ${Python3_LIBRARIES})
set_target_properties(audaspace-py PROPERTIES SOVERSION ${AUDASPACE_VERSION})
install(TARGETS audaspace-py
@@ -1060,17 +1055,17 @@
configure_file(${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py ESCAPE_QUOTES @ONLY)
if(APPLE)
- add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
+ add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${Python3_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
elseif(MSVC)
set(ENV{VS100COMNTOOLS} $ENV{VS120COMNTOOLS})
- add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
+ add_custom_command(OUTPUT build COMMAND ${Python3_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
else()
- add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
+ add_custom_command(OUTPUT build COMMAND ${Python3_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
endif()
add_custom_target(pythonmodule ALL DEPENDS build SOURCES ${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${PYTHON_SRC} ${PYTHON_HDR})
add_dependencies(pythonmodule audaspace)
- install(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} setup.py install --root=\$ENV{DESTDIR} --prefix=${CMAKE_INSTALL_PREFIX})")
+ install(CODE "EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} setup.py install --root=\$ENV{DESTDIR} --prefix=${CMAKE_INSTALL_PREFIX})")
endif()
endif()
@@ -1095,7 +1090,7 @@
if(SPHINX_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bindings/doc/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
- add_custom_target(bindings_doc ALL COMMAND ${PYTHON_EXECUTABLE} setup.py --build-docs ${SPHINX_EXECUTABLE} -q -b html -c "${CMAKE_CURRENT_BINARY_DIR}" -d "${CMAKE_CURRENT_BINARY_DIR}/_doctrees" "${CMAKE_CURRENT_SOURCE_DIR}/bindings/doc" "${CMAKE_CURRENT_BINARY_DIR}/doc/bindings" DEPENDS pythonmodule COMMENT "Building C/Python HTML documentation with Sphinx.")
+ add_custom_target(bindings_doc ALL COMMAND ${Python3_EXECUTABLE} setup.py --build-docs ${SPHINX_EXECUTABLE} -q -b html -c "${CMAKE_CURRENT_BINARY_DIR}" -d "${CMAKE_CURRENT_BINARY_DIR}/_doctrees" "${CMAKE_CURRENT_SOURCE_DIR}/bindings/doc" "${CMAKE_CURRENT_BINARY_DIR}/doc/bindings" DEPENDS pythonmodule COMMENT "Building C/Python HTML documentation with Sphinx.")
else()
set(WITH_BINDING_DOCS FALSE CACHE BOOL "Build C/Python HTML Documentation with Sphinx" FORCE)
message(WARNING "Sphinx not found, binding documentation will not be built.")