Skip to content
Commit 3c00ed4a authored by Dmitry Kazakov's avatar Dmitry Kazakov Committed by Amy spark
Browse files

Python: add functions for converting paths to native form

file(TO_NATIVE_PATH ...) doesn't work on MinGW, that is a known
bug from 2010, so we need to use something else. CMake 3.20.0
introduces cmake_path(CONVERT ...), but we still need to support
older versions.

There is also a problem of expanding lists like ${KRITA_PYTHONPATH}
into the environment variable form, when the list has more than one
element. The list should be expanded like "path1;path2;path3", but
CMake auto-expands that into a space-separated list, like
"path1 path2 path3", which breakes compilation (obviously).

The patch addresses these two problems by introducing two reusable
functions:

krita_to_native_path() --- converts a list of cmake-style paths into
a native form. It will also shortcut into cmake_path(CONVERT ...),
when newer cmake is found (and allowed by cmake_minimum_required).

krita_to_native_environment_path_list() --- takes a list of cmake-style
paths, converts the paths into native form and joins them with $<SEMICOLON>
or $<COLON> depending on the OS.

CCMAIL: kimageshop@kde.org
parent 2ef94c20
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment