From 2b8296884aa7d6a9d9e86c527aca60f2f528be04 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Mon, 28 Oct 2024 17:42:14 +0100 Subject: [PATCH 1/2] 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}") From c6f13bb4e1bdbc728d36c188eda4a5176ab135d6 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Tue, 29 Oct 2024 15:10:47 +0100 Subject: [PATCH 2/2] python: Improve comment --- python.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.cmake b/python.cmake index 608993e3..12de4e9c 100644 --- a/python.cmake +++ b/python.cmake @@ -349,7 +349,7 @@ macro(FINDPYTHON) endif() endif() - # Avoid Windows path + # Avoid paths in Windows format if(PYTHON_SITELIB) file(TO_CMAKE_PATH "${PYTHON_SITELIB}" PYTHON_SITELIB) endif()