Comments (1)
I solved it in a different project like this:
- Create
launch.json.part
per target - Read the
launch.json.part
contents into a CMake variable - Append the contents to a environment variable
LAUNCH_JSON
- Write the
LAUNCH_JSON
to the file
It's a bit ugly b/c the launch.json
gets generated and overwritten once for each target, but it works
# Create launch.json for a target and append it to the global launch.json
function(launch_json PROJ_NAME)
set(LAUNCH_JSON $ENV{LAUNCH_JSON})
configure_file(${TEMPLATE_DIR}/vscode-pyocd.in ${CMAKE_BINARY_DIR}/launch.json.part @ONLY)
file(READ ${CMAKE_BINARY_DIR}/launch.json.part LAUNCH_JSON_PART)
string(APPEND LAUNCH_JSON "${LAUNCH_JSON_PART}")
set(ENV{LAUNCH_JSON} "${LAUNCH_JSON}")
configure_file("${TEMPLATE_DIR}/launch.json.in" "${VSCODE_DIR}/launch.json" @ONLY)
endfunction()
vscode-pyocd.in
{
"name": "@PROJ_NAME@",
"cwd": "${workspaceRoot}/pyocd",
"executable": "${workspaceRoot}/build/@PROJ_NAME@/@[email protected]",
"request": "attach",
"type": "cortex-debug",
"servertype": "pyocd",
"serverArgs": [@PYOCD_ARGLIST_OPT@],
"svdFile": "${workspaceRoot}/pyocd/..."
},
launch.json.in
{
"configurations": [
@LAUNCH_JSON@
]
}
I won't be able to implement and test it myself right now in cubemx.cmake, b/c I'm not working with this stuff at the moment.
from cubemx.cmake.
Related Issues (10)
- Python errors when IOC file not found
- File globbing broken for multiple projects
- CMake error: CubeMX startup file not found HOT 3
- CubeMX compiler settings were not created / considered HOT 12
- Fails to configure if RCC.HSI_VALUE missing HOT 1
- Use gitattributes to force native EOL HOT 1
- Allow to pass extra arguments to bin file creation HOT 3
- Project configuration fails for multiple targets
- ARM GCC Toolchain not found on windows HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cubemx.cmake.