diff --git a/python.cmake b/python.cmake index ea47a90ee..12de4e9c6 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 paths in Windows format + 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}")