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

pull/7618/head
Daniel Mensinger 4 years ago committed by Nirbheek Chauhan
parent 535a2d7285
commit 393c48f345
  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)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
find_package(Python COMPONENTS Interpreter)
else()
find_package(PythonInterp)
endif()
find_package(Python COMPONENTS Interpreter)
if(Python_FOUND OR PYTHONINTERP_FOUND)
set(SomethingLikePython_FOUND ON)
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()
set(SomethingLikePython_FOUND OFF)
endif()

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