From c3ad3ebb578f3cd34ca5c947c230696b169571aa Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 2 Dec 2021 20:56:18 +0200 Subject: [PATCH] Properly replace Home Directory in CLion template on Windows Issue #4071 --- .../project/tpls/clion/CMakeListsPrivate.txt.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl index 82a4b3a6..b8695d0e 100644 --- a/platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl @@ -53,6 +53,11 @@ set(CMAKE_CONFIGURATION_TYPES "{{ ";".join(envs) }};" CACHE STRING "Build Types set(CMAKE_CONFIGURATION_TYPES "{{ env_name }}" CACHE STRING "Build Types reflect PlatformIO Environments" FORCE) % end +# Convert "Home Directory" that may contain unescaped backslashes on Windows +% if "windows" in systype: +file(TO_CMAKE_PATH $ENV{HOMEDRIVE}$ENV{HOMEPATH} ENV_HOME_PATH) +% end + % if svd_path: set(CLION_SVD_FILE_PATH "{{ _normalize_path(svd_path) }}" CACHE FILEPATH "Peripheral Registers Definitions File" FORCE) % end @@ -62,11 +67,6 @@ SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}") SET(CMAKE_CXX_FLAGS "{{ _normalize_path(to_unix_path(cxx_flags)) }}") SET(CMAKE_C_FLAGS "{{ _normalize_path(to_unix_path(cc_flags)) }}") -# Convert "Home Directory" that may contain unescaped backslashes on Windows -% if "windows" in systype: -file(TO_CMAKE_PATH $ENV{HOMEDRIVE}$ENV{HOMEPATH} ENV_HOME_PATH) -% end - % STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)") % cc_stds = STD_RE.findall(cc_flags) % cxx_stds = STD_RE.findall(cxx_flags)