Files
CMake/Tests/FindPython/Python3Fail/CMakeLists.txt
Brad King bd7b2293aa Tests: Bump CMake minimum required version in find-module tests to 3.5
CMake 3.27 deprecates compatibility with CMake < 3.5.
Update find module tests to avoid the deprecation warning.
2023-03-08 15:41:43 -05:00

15 lines
438 B
CMake

cmake_minimum_required(VERSION 3.5)
project(TestPython3Fail C)
include(CTest)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development foobar)
Python3_add_library (spam3 MODULE ../spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
add_test (NAME python3_spam3
COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
"${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")")