diff options
author | Brad King <brad.king@kitware.com> | 2020-08-12 15:13:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-08-12 15:13:16 (GMT) |
commit | 0603eb00f9f3b59054730643d167877051dafabf (patch) | |
tree | 8ed992e49716d377a4add5ba2d75cb077bafd766 /Tests | |
parent | ce2cc7cfb579d99f4392f6b97c93cec3fa08eee3 (diff) | |
parent | 951640f1f92e5da6f1c31135cc3aff527987ee67 (diff) | |
download | CMake-0603eb00f9f3b59054730643d167877051dafabf.zip CMake-0603eb00f9f3b59054730643d167877051dafabf.tar.gz CMake-0603eb00f9f3b59054730643d167877051dafabf.tar.bz2 |
Merge topic 'FindPython-manage-SOABI-in-all-versions'
951640f1f9 FindPython: manage SOABI for all Python versions
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5119
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindPython/SOABI/CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt index 4a6aea3..36daa9f 100644 --- a/Tests/FindPython/SOABI/CMakeLists.txt +++ b/Tests/FindPython/SOABI/CMakeLists.txt @@ -20,3 +20,19 @@ if (Python3_Development_FOUND AND Python3_SOABI) message(FATAL_ERROR "Module suffix do not include Python3_SOABI") endif() endif() + + +find_package(Python2 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) +if(NOT DEFINED Python2_SOABI) + message(FATAL_ERROR "Python2_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") +endif() + +if (Python2_Development_FOUND AND Python2_SOABI) + Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c) + target_compile_definitions (spam2 PRIVATE PYTHON2) + + get_property (suffix TARGET spam2 PROPERTY SUFFIX) + if (NOT suffix MATCHES "^.${Python2_SOABI}") + message(FATAL_ERROR "Module suffix do not include Python2_SOABI") + endif() +endif() |