Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMP0148 with CMake version >= 3.27 #1018

Open
aytey opened this issue Aug 2, 2023 · 0 comments · May be fixed by #1019
Open

CMP0148 with CMake version >= 3.27 #1018

aytey opened this issue Aug 2, 2023 · 0 comments · May be fixed by #1019

Comments

@aytey
Copy link

aytey commented Aug 2, 2023

I am currently running CMake 3.27 (release on July 18th; it is the default of CMake on openSUSE Tumbleweed).

However, if use the following:

cmake_minimum_required(VERSION 3.26)
project(Test)
find_package(
  Python 3 EXACT
  COMPONENTS Interpreter
  REQUIRED
)

find_package(PythonExtensions REQUIRED)

and do the following:

python3 -m venv venv
source venv/bin/activate
pip install git+https://github.com/scikit-build/scikit-build
mkdir build
cd build
rm -rf * && cmake -DCMAKE_MODULE_PATH=$(readlink -f ../venv/lib64/python3.11/site-packages/skbuild/resources/cmake) ..

then I get the following:

-- Found Python: /mnt/baranem/cmake/venv/bin/python3.11 (found suitable exact version "3.11.4") found components: Interpreter
CMake Warning (dev) at venv/lib/python3.11/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:245 (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:9 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /mnt/baranem/cmake/venv/bin/python3.11 (found version "3.11.4")
CMake Warning (dev) at venv/lib/python3.11/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:252 (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:9 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonLibs: /usr/lib64/libpython3.10.so (found version "3.10.12")

This is to do with https://cmake.org/cmake/help/latest/policy/CMP0148.html.

aytey added a commit to aytey/scikit-build that referenced this issue Aug 2, 2023
@aytey aytey linked a pull request Aug 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant