I'm trying to use libfixmath (a plain Makefile based library) in a simple project derived from the blink example, but not having much success in finding the correct incantations for CMakeLists.txt.
I have the libfixmath source tree in my project root directory (no idea if this is correct/conventional) and with this added to my project's CMakeLists:
Code: Select all
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include_directories(libfixmath/libfixmath)
add_library(fixmath STATIC libfixmath/libfixmath)
set_target_properties(fixmath PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(fixmath)
project(blink)
I haven't done anything to the fixmath sources, it just has the makefile it came with, no CMakeLists of its own.
So a couple questions:
I doubt I'm doing this "right", so any tips on generally how to integrate foreign libraries into ESP-IDF projects is helpful. I'm not at all familiar with cmake in general and it's complex even before adding in the IDF toolchain.
I'm getting my library built, but despite passing in that link_libraries directive, it's very obviously not getting linked in. How do I tell cmake that I want to link it in?
CMake docs and blog posts seem to span from "very simple example project" to "massive multiplatform desktop app with 1000 deps", with not much covering the simple use case of integrating a fairly trivial 3rd party library.