summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-01-07 15:42:15 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-01-09 13:43:22 (GMT)
commit61502d395609672cd101da74d290895d20b0e7c7 (patch)
treee4e208381f5a5fb5268a60fd7ddf0a70c5a5e616 /Tests/FindPython
parent635225513e2139559cc3e31acc8006377e01fc94 (diff)
downloadCMake-61502d395609672cd101da74d290895d20b0e7c7.zip
CMake-61502d395609672cd101da74d290895d20b0e7c7.tar.gz
CMake-61502d395609672cd101da74d290895d20b0e7c7.tar.bz2
FindPython: Add variable Python_SOABI
This variable holds the standard extension suffix for modules. Fixes: #20150
Diffstat (limited to 'Tests/FindPython')
-rw-r--r--Tests/FindPython/CMakeLists.txt28
-rw-r--r--Tests/FindPython/SOABI/CMakeLists.txt12
2 files changed, 40 insertions, 0 deletions
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 5e20dd3..bfec986 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -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)
diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt
new file mode 100644
index 0000000..aea2baf
--- /dev/null
+++ b/Tests/FindPython/SOABI/CMakeLists.txt
@@ -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()