Skip to content

Commit

Permalink
CMake: Drop PYTHON_EXTENSION_MODULE_SUFFIX logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Sep 3, 2024
1 parent 6424c34 commit 6476591
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ if (NUMPY_FOUND AND Python_FOUND)

set_target_properties (nlopt_python PROPERTIES OUTPUT_NAME nlopt)

if (NOT DEFINED PYTHON_EXTENSION_MODULE_SUFFIX AND NOT CMAKE_CROSSCOMPILING)
execute_process (COMMAND ${Python_EXECUTABLE} -c "import importlib.machinery; print(importlib.machinery.EXTENSION_SUFFIXES[0])"
OUTPUT_VARIABLE PYTHON_EXTENSION_MODULE_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
if (DEFINED PYTHON_EXTENSION_MODULE_SUFFIX)
set_target_properties (nlopt_python PROPERTIES SUFFIX "${PYTHON_EXTENSION_MODULE_SUFFIX}")
endif ()

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/nlopt.py DESTINATION ${INSTALL_PYTHON_DIR})
install (TARGETS nlopt_python DESTINATION ${INSTALL_PYTHON_DIR})

Expand Down

0 comments on commit 6476591

Please sign in to comment.