aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake17
-rw-r--r--test cases/cmake/11 cmake_module_path/test.json5
2 files changed, 6 insertions, 16 deletions
diff --git a/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake b/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake
index 4a189bf..0c663f4 100644
--- a/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake
+++ b/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake
@@ -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()
diff --git a/test cases/cmake/11 cmake_module_path/test.json b/test cases/cmake/11 cmake_module_path/test.json
new file mode 100644
index 0000000..79a2b60
--- /dev/null
+++ b/test cases/cmake/11 cmake_module_path/test.json
@@ -0,0 +1,5 @@
+{
+ "tools": {
+ "cmake": ">=3.12"
+ }
+}