Migrating from legacy to CMake build
Posted: Wed Dec 18, 2019 6:34 pm
Have ended up playing 'toolchain' pinball; you know you want to add a feature but your toolchain has an issue & so you have to switch to another toolchain (all I have to do is...) and then you find a whole new world of pain
I have a legacy GNU makefile build and now need to migrate to CMake (ESP-IDF 4.1 legacy build seems C++11 broken).
I have not found a simple legacy GNU to CMake 'translation' tutorial.
The problem is that the examples are single instance e.g. examples show single extra directory:
but I need to convert:
In other words I need to understand how to list directories or add to the appropriate variable.
The makefile commands I need to translate are (above)+:
Add a pre-built library:
Add multiple include paths
I have a legacy GNU makefile build and now need to migrate to CMake (ESP-IDF 4.1 legacy build seems C++11 broken).
I have not found a simple legacy GNU to CMake 'translation' tutorial.
The problem is that the examples are single instance e.g. examples show single extra directory:
Code: Select all
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
Code: Select all
EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/components/WebApp/image
EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/components/NMEA/Application
The makefile commands I need to translate are (above)+:
Add a pre-built library:
Code: Select all
# The following three lines link in the pre-built NMEA library.
LIBS := nmea
COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib \
$(addprefix -l,$(LIBS))
Add multiple include paths
Code: Select all
COMPONENT_PRIV_INCLUDEDIRS := include ../../../database/include ../../../third-party/include