mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Add the following variables: * Python_EXECUTABLE_DEBUG * Python_INTERPRETER * Python_DEBUG_POSTFIX and target Python::InterpreterDebug. python_add_library() command Manage DEBUG_POSTFIX target property based on the value of Python_DEBUG_POSTFIX variable. Fixes: #25874
50 lines
1.5 KiB
CMake
50 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(TestRequiredArtifacts.Check LANGUAGES C)
|
|
|
|
set (components)
|
|
if (CHECK_INTERPRETER)
|
|
set (required_interpreter "${Python3_EXECUTABLE}")
|
|
list (APPEND components Interpreter)
|
|
endif()
|
|
if (CHECK_LIBRARY OR CHECK_INCLUDE)
|
|
list (APPEND components Development)
|
|
if (CHECK_LIBRARY)
|
|
set (required_library "${Python3_LIBRARY}")
|
|
endif()
|
|
if (CHECK_INCLUDE)
|
|
set (required_include "${Python3_INCLUDE_DIR}")
|
|
endif()
|
|
endif()
|
|
if (CHECK_SABI_LIBRARY)
|
|
list (APPEND components Development.SABIModule)
|
|
set (required_sabi_library "${Python3_SABI_LIBRARY}")
|
|
endif()
|
|
|
|
find_package (Python3 COMPONENTS ${components})
|
|
|
|
|
|
if (PYTHON_IS_FOUND AND NOT Python3_FOUND)
|
|
message (FATAL_ERROR "Python3 unexpectedly not found")
|
|
endif()
|
|
if (NOT PYTHON_IS_FOUND AND Python3_FOUND)
|
|
message (FATAL_ERROR "Python3 unexpectedly found")
|
|
endif()
|
|
|
|
|
|
if (CHECK_INTERPRETER AND NOT Python3_EXECUTABLE STREQUAL required_interpreter)
|
|
message (FATAL_ERROR "Failed to use input variable Python3_EXECUTABLE")
|
|
endif()
|
|
|
|
if (CHECK_LIBRARY AND NOT Python3_LIBRARY_RELEASE STREQUAL required_library)
|
|
message (FATAL_ERROR "Failed to use input variable Python3_LIBRARY")
|
|
endif()
|
|
|
|
if (CHECK_INCLUDE AND NOT Python3_INCLUDE_DIRS STREQUAL required_include)
|
|
message (FATAL_ERROR "Failed to use input variable Python3_INCLUDE_DIR")
|
|
endif()
|
|
|
|
if (CHECK_SABI_LIBRARY AND NOT Python3_SABI_LIBRARY_RELEASE STREQUAL required_sabi_library)
|
|
message (FATAL_ERROR "Failed to use input variable Python3_SABI_LIBRARY")
|
|
endif()
|