mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-16 11:21:41 -05:00
FindPython: Add variable Python_SOABI
This variable holds the standard extension suffix for modules. Fixes: #20150
This commit is contained in:
@@ -148,6 +148,34 @@ if(CMake_TEST_FindPython)
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
add_test(NAME FindPython.Interpreter.SOABI COMMAND
|
||||
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
|
||||
--build-and-test
|
||||
"${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
|
||||
"${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
|
||||
${build_generator_args}
|
||||
--build-project TestSOABI
|
||||
--build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
|
||||
"-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
|
||||
"-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
|
||||
"-DCMake_TEST_FindPython_COMPONENT=Interpreter"
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
add_test(NAME FindPython.Development.SOABI COMMAND
|
||||
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
|
||||
--build-and-test
|
||||
"${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
|
||||
"${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
|
||||
${build_generator_args}
|
||||
--build-project TestSOABI
|
||||
--build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
|
||||
"-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
|
||||
"-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
|
||||
"-DCMake_TEST_FindPython_COMPONENT=Development"
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMake_TEST_FindPython_NumPy)
|
||||
|
||||
12
Tests/FindPython/SOABI/CMakeLists.txt
Normal file
12
Tests/FindPython/SOABI/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
project(TestSOABI C)
|
||||
|
||||
find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT})
|
||||
if (NOT Python3_FOUND)
|
||||
message (FATAL_ERROR "Fail to found Python 3")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED Python3_SOABI)
|
||||
message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found")
|
||||
endif()
|
||||
Reference in New Issue
Block a user