I'm sorry if this is has an obvious answer, but I haven't played with C/C++ enough to know for sure; still learning. :)
Also sorry if this has an answer written somewhere; I can be a mole sometimes.
I'm running into an issue trying to setup cmocka for a project, using CMAKE, Ninja, and espressif; all for an ESP32. I'll share what I can, but some things are private for company reasons.
Some information that might help:
Linux Kernel 6.8.0
Pop!_OS 22.04 LTS (Ubuntu 22.04 derivative)
cmake version 3.22.1
GNU Make 4.3
ninja 1.10.1
ESP-IDF v4.4.7-92-g718cdd6c65
I run into this issue when trying to build:
CMake Error at CMakeLists.txt:16 (find_package):
Could not find a configuration file for package "cmocka" that is compatible
with requested version "1.1.5".
The following configuration files were considered but not accepted:
/usr/local/lib/cmake/cmocka/cmocka-config.cmake, version: 1.1.5 (64bit)
As you can see, I have compiled cmocka, and I have just taken it from the master branch; it compiled without issue.
I have the following CMakeList.txt:
# The following four lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common main/esp-protocols-master/components/esp_modem main/components)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ThisIsAProjectName)
# Add CMocka CMake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmocka)
if (UNIT_TESTING)
find_package(cmocka 1.1.5 REQUIRED)
include(AddCMockaTest)
add_subdirectory(tests)
endif()
Have I missed anything? Have I missed anything in the documentation? I can't seem to find anything about this.
If you need more information, please ask, and I'll supply it if I can.
Edit
I forgot, but I use a build script (simply called build.sh) to build a bin file, which looks like this:
Hi!
I'm sorry if this is has an obvious answer, but I haven't played with C/C++ enough to know for sure; still learning. :) Also sorry if this has an answer written somewhere; I can be a mole sometimes.
I'm running into an issue trying to setup cmocka for a project, using CMAKE, Ninja, and espressif; all for an ESP32. I'll share what I can, but some things are private for company reasons.
Some information that might help:
I run into this issue when trying to build:
As you can see, I have compiled cmocka, and I have just taken it from the master branch; it compiled without issue.
I have the following CMakeList.txt:
Have I missed anything? Have I missed anything in the documentation? I can't seem to find anything about this.
If you need more information, please ask, and I'll supply it if I can.
Edit
I forgot, but I use a build script (simply called build.sh) to build a
bin
file, which looks like this: