From: Kefu Chai Date: Thu, 19 Dec 2019 02:56:16 +0000 (+0800) Subject: cmake: CMAKE_ROLE defaults to "PROJECT" X-Git-Tag: v15.1.0~436^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47d0e1e16d4cd7a4cc3211a5b39a125b602c299b;p=ceph.git cmake: CMAKE_ROLE defaults to "PROJECT" so we can use exported targets like "Python3::Python", which is defined only if CMAKE_ROLE is "PROJECT". but this global property was introduced by CMake 3.14, but the minimum required version of CMake is 3.10.2 in Ceph project at this moment. let's set it if it's not defined. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/FindPython/Support.cmake b/cmake/modules/FindPython/Support.cmake index b2bdc00250bcb..6584699b7976d 100644 --- a/cmake/modules/FindPython/Support.cmake +++ b/cmake/modules/FindPython/Support.cmake @@ -25,6 +25,10 @@ else() endif() get_property(_${_PYTHON_PREFIX}_CMAKE_ROLE GLOBAL PROPERTY CMAKE_ROLE) +if (NOT DEFINED _${_PYTHON_PREFIX}_CMAKE_ROLE) + # CMake 3.14 introduced CMAKE_ROLE + set(_${_PYTHON_PREFIX}_CMAKE_ROLE "PROJECT") +endif() #