CMake: An Introduction (2024-06-18)¶
Exercise: see https://github.com/jfasch/2024-06-18/tree/main/exercise
Cross development
Sample CMake toolchain file here
-
Add MQTT logic to exercise project ⟶ need to know about mosquitto installation (include path, library)
Handwritten (simplistic) find module: FileMosquitto.cmake
Find mosquitto in toplevel CMakeLists.txt
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") find_package(Mosquitto)
Add dependency in base CMakeLists.txt
target_link_libraries(base Mosquitto::Mosquitto)