diff --git a/platformio/ide/tpls/clion/.gitignore.tpl b/platformio/ide/tpls/clion/.gitignore.tpl
index ff1a5181..3fe18ad4 100644
--- a/platformio/ide/tpls/clion/.gitignore.tpl
+++ b/platformio/ide/tpls/clion/.gitignore.tpl
@@ -1,2 +1,3 @@
.pio
CMakeListsPrivate.txt
+cmake-build-*/
diff --git a/platformio/ide/tpls/clion/.idea/clion.iml.tpl b/platformio/ide/tpls/clion/.idea/clion.iml.tpl
deleted file mode 100644
index bc2cd874..00000000
--- a/platformio/ide/tpls/clion/.idea/clion.iml.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/platformio/ide/tpls/clion/.idea/misc.xml.tpl b/platformio/ide/tpls/clion/.idea/misc.xml.tpl
deleted file mode 100644
index 3463fba1..00000000
--- a/platformio/ide/tpls/clion/.idea/misc.xml.tpl
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/platformio/ide/tpls/clion/.idea/modules.xml.tpl b/platformio/ide/tpls/clion/.idea/modules.xml.tpl
deleted file mode 100644
index 9ce81f04..00000000
--- a/platformio/ide/tpls/clion/.idea/modules.xml.tpl
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/platformio/ide/tpls/clion/.idea/platformio.iml.tpl b/platformio/ide/tpls/clion/.idea/platformio.iml.tpl
deleted file mode 100644
index bc2cd874..00000000
--- a/platformio/ide/tpls/clion/.idea/platformio.iml.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/platformio/ide/tpls/clion/.idea/watcherTasks.xml.tpl b/platformio/ide/tpls/clion/.idea/watcherTasks.xml.tpl
deleted file mode 100644
index fcf8b23d..00000000
--- a/platformio/ide/tpls/clion/.idea/watcherTasks.xml.tpl
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/platformio/ide/tpls/clion/.idea/workspace.xml.tpl b/platformio/ide/tpls/clion/.idea/workspace.xml.tpl
deleted file mode 100644
index d9cf6a8f..00000000
--- a/platformio/ide/tpls/clion/.idea/workspace.xml.tpl
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-% envs = config.envs()
-% if len(envs) > 1:
-% for env in envs:
-
-% end
-
-% else:
-
-% end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- % for file in src_files:
-
-
-
- % end
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C/C++
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1435919971910
-
- 1435919971910
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl
index 52848378..3153e616 100644
--- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl
+++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl
@@ -5,9 +5,12 @@
# please create `CMakeListsUser.txt` in the root of project.
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.13)
+set(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_C_COMPILER_WORKS 1)
+set(CMAKE_CXX_COMPILER_WORKS 1)
-project("{{project_name}}")
+project("{{project_name}}" C CXX)
include(CMakeListsPrivate.txt)
@@ -16,74 +19,14 @@ include(CMakeListsUser.txt)
endif()
add_custom_target(
- PLATFORMIO_BUILD ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run "$<$>:-e${CMAKE_BUILD_TYPE}>"
+ Production ALL
+ COMMAND platformio -c clion run "$<$>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
- PLATFORMIO_BUILD_VERBOSE ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_UPLOAD ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_CLEAN ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_MONITOR ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_TEST ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion test "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_PROGRAM ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_UPLOADFS ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_BUILD_DEBUG ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion run --target debug "$<$>:-e${CMAKE_BUILD_TYPE}>"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_UPDATE_ALL ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion update
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_REBUILD_PROJECT_INDEX ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion init --ide clion
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-add_custom_target(
- PLATFORMIO_DEVICE_LIST ALL
- COMMAND ${PLATFORMIO_CMD} -f -c clion device list
+ Debug ALL
+ COMMAND platformio -c clion run --target debug "$<$>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl
index 0c6eda0c..df8171fa 100644
--- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl
+++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl
@@ -29,14 +29,13 @@
% envs = config.envs()
% if len(envs) > 1:
-set(CMAKE_CONFIGURATION_TYPES "{{ ";".join(envs) }};" CACHE STRING "" FORCE)
+set(CMAKE_CONFIGURATION_TYPES "{{ ";".join(envs) }};" CACHE STRING "Build Types reflect PlatformIO Environments" FORCE)
% else:
-set(CMAKE_CONFIGURATION_TYPES "{{ env_name }}" CACHE STRING "" FORCE)
+set(CMAKE_CONFIGURATION_TYPES "{{ env_name }}" CACHE STRING "Build Types reflect PlatformIO Environments" FORCE)
% end
-set(PLATFORMIO_CMD "{{ _normalize_path(platformio_path) }}")
% if svd_path:
-set(SVD_PATH "{{ _normalize_path(svd_path) }}")
+set(CLION_SVD_FILE_PATH "{{ _normalize_path(svd_path) }}" CACHE FILEPATH "Peripheral Registers Definitions File" FORCE)
% end
SET(CMAKE_C_COMPILER "{{ _normalize_path(cc_path) }}")