Migrating a CMake project from ESP-IDF v3.2 to v3.3 - component "main" error
Posted: Sun Nov 17, 2019 12:21 am
I have a CMakeLists.txt that works fine with ESP IDF v3.2, but when I try to build it (from clean check-out) with ESP IDF v3.3 I get the following CMake error:
Line 9 of my CMakeLists.txt file looks like this:
(This is required to keep CLion happy)
So the target "main" was valid with the IDF v3.2 build system, but does not seem to exist with the v3.3 build system.
I have other directives that also use the "main" target and they show the same error.
Is there an easy fix for this?
Code: Select all
$ $IDF_PATH/tools/idf.py build
[...]
-- Component paths: [...];/home/me/my-project/main
[...]
-- Component libraries:
CMake Error at CMakeLists.txt:9 (target_compile_options):
Cannot specify compile options for target "main" which is not built by this
project.
Code: Select all
target_compile_options(main PRIVATE -Wno-unknown-pragmas)
So the target "main" was valid with the IDF v3.2 build system, but does not seem to exist with the v3.3 build system.
I have other directives that also use the "main" target and they show the same error.
Is there an easy fix for this?