diff --git a/HISTORY.rst b/HISTORY.rst index a55333dd..1c43db1c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,15 @@ Release Notes PlatformIO 3.0 -------------- +3.6.4 (2018-??-??) +~~~~~~~~~~~~~~~~~~ + +* Improved Project Generator for IDEs: + + - Use full path to PlatformIO CLI when generating a project + (`issue #1674 `_) + - CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path + 3.6.3 (2018-12-12) ~~~~~~~~~~~~~~~~~~ @@ -50,7 +59,6 @@ PlatformIO 3.0 (`issue #1873 `_) * Fixed an issue with incorrect handling of a custom package name when using `platformio lib install `__ or `platformio platform install `__ commands - 3.6.0 (2018-08-06) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl index 3c4bed47..65423e22 100644 --- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl @@ -1,8 +1,20 @@ -set(ENV{PATH} "{{env_path}}") -set(PLATFORMIO_CMD "{{platformio_path}}") +% def _normalize_path(path): +% if user_home_dir in path: +% if "windows" in systype: +% path = path.replace(user_home_dir, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}") +% else: +% path = path.replace(user_home_dir, "$ENV{HOME}") +% end +% elif project_dir in path: +% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}") +% end +% return path.replace("\\", "/") +% end -SET(CMAKE_C_COMPILER "{{cc_path.replace("\\", "/")}}") -SET(CMAKE_CXX_COMPILER "{{cxx_path.replace("\\", "/")}}") +set(PLATFORMIO_CMD "{{ _normalize_path(platformio_path) }}") + +SET(CMAKE_C_COMPILER "{{ _normalize_path(cc_path) }}") +SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}") SET(CMAKE_CXX_FLAGS_DISTRIBUTION "{{cxx_flags}}") SET(CMAKE_C_FLAGS_DISTRIBUTION "{{cc_flags}}") set(CMAKE_CXX_STANDARD 11) @@ -13,15 +25,7 @@ add_definitions(-D'{{!re.sub(r"([\"\(\)#])", r"\\\1", define)}}') % end % for include in includes: -% if include.startswith(user_home_dir): -% if "windows" in systype: -include_directories("$ENV{HOMEDRIVE}$ENV{HOMEPATH}{{include.replace(user_home_dir, '').replace("\\", "/")}}") -% else: -include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}") -% end -% else: -include_directories("{{include.replace("\\", "/")}}") -% end +include_directories("{{ _normalize_path(include) }}") % end -FILE(GLOB_RECURSE SRC_LIST "{{project_src_dir.replace("\\", "/")}}/*.*" "{{project_lib_dir.replace("\\", "/")}}/*.*" "{{project_libdeps_dir.replace("\\", "/")}}/*.*") +FILE(GLOB_RECURSE SRC_LIST "{{ _normalize_path(project_src_dir) }}/*.*" "{{ _normalize_path(project_lib_dir) }}/*.*" "{{ _normalize_path(project_libdeps_dir) }}/*.*")