Skip to content

Feature Request: Add ${PROJECT_NAME} to Targets in generated CMakeLists.txt #3839

Open
@MikeMitterer

Description

@MikeMitterer

Configuration

Operating system: OSX 10.15.7

PlatformIO Version (platformio --version): 5.1.0

Description of problem

In a multi-project environment e.g.

├── CMakeLists.txt
├── Door
│   ├── CMakeLists.txt
│   ├── CMakeListsPrivate.txt
│   ├── CMakeListsUser.txt
├── LaserSensor
│   ├── CMakeLists.txt
│   ├── CMakeListsPrivate.txt
│   ├── CMakeListsUser.txt

you generated CMakeLists.txt in 'Door' and in 'LaserSensor' does not work anymore because
each of the files has as target "Production" and "Debug"

The solution is easy:

add_custom_target(
        ${PROJECT_NAME}_Production ALL
        COMMAND platformio -c clion run "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

But every time I have to regenerate the pio init --ide clion CMakeLists it throws out my changes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions