From e0b9d080fa099c2ead66867a48d039d4ae08a148 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 23 Feb 2019 22:34:36 +0200 Subject: [PATCH] Project Generator: add new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) // Resolve #359 --- HISTORY.rst | 2 ++ docs | 2 +- platformio/ide/tpls/clion/CMakeLists.txt.tpl | 12 ++++++++++++ platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index b5b339af..c9384b85 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,8 @@ PlatformIO 4.0 * Added Python 3.5+ support (`issue #895 `_) +* Project Generator: added new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) + (`issue #359 `_) * Fixed an issue with slow updating of PlatformIO Core packages on Windows * Fixed an issue when `platformio ci `__ recompiles project if ``--keep-build-dir`` option is passed (`issue #2109 `_) diff --git a/docs b/docs index 6270f547..11ed4498 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6270f547f8388d91f4c1e1744cb4ae2c0b395d0a +Subproject commit 11ed449808bb8202d1212113afce25b4f3ebfbc5 diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index 63274c43..7b17a983 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -9,6 +9,12 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_custom_target( + PLATFORMIO_BUILD_VERBOSE ALL + COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_custom_target( PLATFORMIO_UPLOAD ALL COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload @@ -21,6 +27,12 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_custom_target( + PLATFORMIO_MONITOR ALL + COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_custom_target( PLATFORMIO_TEST ALL COMMAND ${PLATFORMIO_CMD} -f -c clion test diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl index a1c84d68..0f7c053e 100644 --- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl @@ -1,3 +1,7 @@ +# !!! WARNING !!! +# PLEASE DO NOT MODIFY THIS FILE! +# USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags + % def _normalize_path(path): % if project_dir in path: % path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}")