cmake: Only run the cmake_module_path test for CMake >= 3.12

pull/7527/head
Daniel Mensinger 4 years ago
parent 1c1ec9ff11
commit f16149cc49
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 17
      test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake
  2. 5
      test cases/cmake/11 cmake_module_path/test.json

@ -1,24 +1,9 @@
cmake_policy(VERSION 3.7) cmake_policy(VERSION 3.7)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) find_package(Python COMPONENTS Interpreter)
find_package(Python COMPONENTS Interpreter)
else()
find_package(PythonInterp)
endif()
if(Python_FOUND OR PYTHONINTERP_FOUND) if(Python_FOUND OR PYTHONINTERP_FOUND)
set(SomethingLikePython_FOUND ON) set(SomethingLikePython_FOUND ON)
set(SomethingLikePython_EXECUTABLE ${Python_EXECUTABLE}) set(SomethingLikePython_EXECUTABLE ${Python_EXECUTABLE})
if(NOT DEFINED Python_VERSION)
set(Python_VERSION ${Python_VERSION_STRING})
endif()
if(NOT TARGET Python::Interpreter)
add_executable(Python::Interpreter IMPORTED)
set_target_properties(Python::Interpreter PROPERTIES
IMPORTED_LOCATION ${Python_EXECUTABLE}
VERSION ${Python_VERSION})
endif()
else() else()
set(SomethingLikePython_FOUND OFF) set(SomethingLikePython_FOUND OFF)
endif() endif()

@ -0,0 +1,5 @@
{
"tools": {
"cmake": ">=3.12"
}
}
Loading…
Cancel
Save