Files
CMake/Tests/FindPython/Python2Fail/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(TestPython2Fail C)
include(CTest)
find_package(Python2 REQUIRED COMPONENTS Interpreter Development foobar)
Python2_add_library (spam2 MODULE ../spam.c)
target_compile_definitions (spam2 PRIVATE PYTHON2)
add_test (NAME python2_spam2
COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam2>"
"${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")")