diff options
author | Brad King <brad.king@kitware.com> | 2023-03-30 14:13:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-30 16:05:09 (GMT) |
commit | a4c5b91f80003d007cddbb0de95032d65ec98ace (patch) | |
tree | 591d68a94107253b48f6398a3188e1c89169e0c8 /Tests/RunCMake/find_package | |
parent | 4901fdb201bc6264e976e105780a490d9c0eba19 (diff) | |
download | CMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.zip CMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.tar.gz CMake-a4c5b91f80003d007cddbb0de95032d65ec98ace.tar.bz2 |
FindPython{Interp,Libs}: Add policy to remove these modules
The `FindPythonInterp` and `FindPythonLibs` modules have been deprecated
since CMake 3.12. Add a policy to pretend they do not exist in order to
encourage projects to port to `FindPython` or `FindPython{2,3}`.
Diffstat (limited to 'Tests/RunCMake/find_package')
11 files changed, 70 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/CMP0148-Interp-NEW-stderr.txt b/Tests/RunCMake/find_package/CMP0148-Interp-NEW-stderr.txt new file mode 100644 index 0000000..68b40f7 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Interp-NEW-stderr.txt @@ -0,0 +1,4 @@ +^CMake Warning at CMP0148-Interp-NEW\.cmake:[0-9]+ \(find_package\): + No "FindPythonInterp\.cmake" found in CMAKE_MODULE_PATH\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/find_package/CMP0148-Interp-NEW.cmake b/Tests/RunCMake/find_package/CMP0148-Interp-NEW.cmake new file mode 100644 index 0000000..ccd04f5 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Interp-NEW.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0148 NEW) +set(_FindPythonInterp_testing TRUE) +find_package(PythonInterp MODULE) + +if(_FindPythonInterp_included) + message(FATAL_ERROR "FindPythonInterp.cmake erroneously included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0148-Interp-OLD.cmake b/Tests/RunCMake/find_package/CMP0148-Interp-OLD.cmake new file mode 100644 index 0000000..1879d19 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Interp-OLD.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0148 OLD) +set(_FindPythonInterp_testing TRUE) +find_package(PythonInterp MODULE) + +if(NOT _FindPythonInterp_included) + message(FATAL_ERROR "FindPythonInterp.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0148-Interp-WARN-stderr.txt b/Tests/RunCMake/find_package/CMP0148-Interp-WARN-stderr.txt new file mode 100644 index 0000000..2666c22 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Interp-WARN-stderr.txt @@ -0,0 +1,8 @@ +CMake Warning \(dev\) at CMP0148-Interp-WARN\.cmake:[0-9]+ \(find_package\): + Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules + are removed\. Run "cmake --help-policy CMP0148" for policy details\. Use + the cmake_policy command to set the policy and suppress this warning\. + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/find_package/CMP0148-Interp-WARN.cmake b/Tests/RunCMake/find_package/CMP0148-Interp-WARN.cmake new file mode 100644 index 0000000..53b60af --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Interp-WARN.cmake @@ -0,0 +1,6 @@ +set(_FindPythonInterp_testing TRUE) +find_package(PythonInterp MODULE) + +if(NOT _FindPythonInterp_included) + message(FATAL_ERROR "FindPythonInterp.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0148-Libs-NEW-stderr.txt b/Tests/RunCMake/find_package/CMP0148-Libs-NEW-stderr.txt new file mode 100644 index 0000000..d92b434 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Libs-NEW-stderr.txt @@ -0,0 +1,4 @@ +^CMake Warning at CMP0148-Libs-NEW\.cmake:[0-9]+ \(find_package\): + No "FindPythonLibs\.cmake" found in CMAKE_MODULE_PATH\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/find_package/CMP0148-Libs-NEW.cmake b/Tests/RunCMake/find_package/CMP0148-Libs-NEW.cmake new file mode 100644 index 0000000..2ef8c46 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Libs-NEW.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0148 NEW) +set(_FindPythonLibs_testing TRUE) +find_package(PythonLibs MODULE) + +if(_FindPythonLibs_included) + message(FATAL_ERROR "FindPythonLibs.cmake erroneously included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0148-Libs-OLD.cmake b/Tests/RunCMake/find_package/CMP0148-Libs-OLD.cmake new file mode 100644 index 0000000..06fd6a6 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Libs-OLD.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0148 OLD) +set(_FindPythonLibs_testing TRUE) +find_package(PythonLibs MODULE) + +if(NOT _FindPythonLibs_included) + message(FATAL_ERROR "FindPythonLibs.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0148-Libs-WARN-stderr.txt b/Tests/RunCMake/find_package/CMP0148-Libs-WARN-stderr.txt new file mode 100644 index 0000000..5210e51 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Libs-WARN-stderr.txt @@ -0,0 +1,8 @@ +CMake Warning \(dev\) at CMP0148-Libs-WARN\.cmake:[0-9]+ \(find_package\): + Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules + are removed\. Run "cmake --help-policy CMP0148" for policy details\. Use + the cmake_policy command to set the policy and suppress this warning\. + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/find_package/CMP0148-Libs-WARN.cmake b/Tests/RunCMake/find_package/CMP0148-Libs-WARN.cmake new file mode 100644 index 0000000..9bbe066 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0148-Libs-WARN.cmake @@ -0,0 +1,6 @@ +set(_FindPythonLibs_testing TRUE) +find_package(PythonLibs MODULE) + +if(NOT _FindPythonLibs_included) + message(FATAL_ERROR "FindPythonLibs.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 26eb908..006757a 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -47,6 +47,12 @@ if(RunCMake_GENERATOR MATCHES "Visual Studio") run_cmake(CMP0147-WARN) run_cmake(CMP0147-NEW) endif() +run_cmake(CMP0148-Interp-OLD) +run_cmake(CMP0148-Interp-WARN) +run_cmake(CMP0148-Interp-NEW) +run_cmake(CMP0148-Libs-OLD) +run_cmake(CMP0148-Libs-WARN) +run_cmake(CMP0148-Libs-NEW) run_cmake(WrongVersionRange) run_cmake(EmptyVersionRange) run_cmake(VersionRangeWithEXACT) |