From 7beb332b3170141331b1c58837d3380872b1adcc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 25 May 2019 20:46:56 +0300 Subject: [PATCH] Support custom CMake configuration for CLion IDE using ``CMakeListsUser.txt`` file --- HISTORY.rst | 1 + platformio/ide/tpls/clion/CMakeLists.txt.tpl | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 379224a7..8fe10b5e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -41,6 +41,7 @@ PlatformIO 3.0 3.6.8 (2019-??-??) ~~~~~~~~~~~~~~~~~~ +* Support custom CMake configuration for CLion IDE using ``CMakeListsUser.txt`` file * Fixed "systemd-udevd" warnings in `99-platformio-udev.rules `__ (`issue #2442 `_) * Fixed an issue when ``-U`` in ``build_flags`` does not remove macro previously defined via ``-D`` flag (`issue #2508 `_) * Fixed an issue for Project Generator when include path search order is inconsistent to what passed to the compiler (`issue #2509 `_) diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index 7b17a983..526aeafe 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -1,8 +1,19 @@ +# !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE +# https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags +# +# If you need to override existing CMake configuration or add extra, +# please create `CMakeListsUser.txt` in the root of project. +# The `CMakeListsUser.txt` will not be overwritten by PlatformIO. + cmake_minimum_required(VERSION 3.2) project({{project_name}}) include(CMakeListsPrivate.txt) +if(EXISTS CMakeListsUser.txt) +include(CMakeListsUser.txt) +endif() + add_custom_target( PLATFORMIO_BUILD ALL COMMAND ${PLATFORMIO_CMD} -f -c clion run