Skip to content

Commit fbcd1f5

Browse files
committed
PYBE RHEL
1 parent a2564ea commit fbcd1f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ FetchContent_Declare(
9292
GIT_TAG "aa304c9c7d725ffb9d10af08a3b34cb372307020"
9393
GIT_SHALLOW ON
9494
)
95+
96+
# RHEL base container has multiple version of Python installed. By default
97+
# it seems like pybind will pickup v3.6, so we specifically assign it to
98+
# search for 3.12 here.
99+
if(LINUX)
100+
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
101+
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
102+
set(PYBIND11_PYTHON_VERSION 3.12)
103+
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
104+
endif(LINUX)
95105
FetchContent_MakeAvailable(pybind11)
96106

97107
#

0 commit comments

Comments
 (0)