From 2b8296884aa7d6a9d9e86c527aca60f2f528be04 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Mon, 28 Oct 2024 17:42:14 +0100 Subject: [PATCH] python: Remove Windows path separator in PYTHON_SITELIB --- python.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python.cmake b/python.cmake index ea47a90e..608993e3 100644 --- a/python.cmake +++ b/python.cmake @@ -292,9 +292,7 @@ macro(FINDPYTHON) message(STATUS "PythonLibraryDirs: ${PYTHON_LIBRARY_DIRS}") message(STATUS "PythonLibVersionString: ${PYTHONLIBS_VERSION_STRING}") - if(PYTHON_SITELIB) - file(TO_CMAKE_PATH "${PYTHON_SITELIB}" PYTHON_SITELIB) - else() + if(NOT PYTHON_SITELIB) # Use either site-packages (default) or dist-packages (Debian packages) # directory option(PYTHON_DEB_LAYOUT "Enable Debian-style Python package layout" OFF) @@ -351,6 +349,11 @@ macro(FINDPYTHON) endif() endif() + # Avoid Windows path + if(PYTHON_SITELIB) + file(TO_CMAKE_PATH "${PYTHON_SITELIB}" PYTHON_SITELIB) + endif() + message(STATUS "Python site lib: ${PYTHON_SITELIB}") message(STATUS "Python include dirs: ${PYTHON_INCLUDE_DIRS}")