Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The following configuration files were considered but not accepted" #26

Closed
inuitviking opened this issue Apr 15, 2024 · 1 comment
Closed

Comments

@inuitviking
Copy link

inuitviking commented Apr 15, 2024

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:

  • 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:

#!/bin/bash

#/opt/esp/python_env/idf4.4_py3.8_env/bin/python -m pip install --upgrade idf-component-manager
~/.espressif/python_env/idf4.4_py3.10_env/bin/python -m pip install --upgrade idf-component-manager

echo Delete Build folder...
rm -r -f ./build

echo Version.txt contains version
cat ./version.txt

echo Running cmake...
cmake ./ -G "Ninja" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 -DCMOCKA_PATH="/var/projekter/cmocka" -DUNIT_TESTING=ON -B ./build

echo Run Ninja in Debug folder...
cd build
/usr/bin/ninja
@diasbruno
Copy link
Member

diasbruno commented Apr 15, 2024

Hi @inuitviking. Better post this question on upstream repository as this is just a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants