OpenEmbedded层cpsumon项目CMake相关Make install报错求助
Let's break down why you're hitting this error and walk through actionable fixes step by step:
1. The Root Cause: Missing install Rules in Your CMakeLists.txt
This error means the Makefile generated by CMake doesn't include an install target. 9 times out of 10, this happens because your project's CMakeLists.txt lacks explicit installation directives—CMake won't guess how to copy your binaries, config files, or other assets to the target filesystem.
Check your CMakeLists.txt for lines like these (adjust paths to match your project structure):
# Install the cpsumon binary to the system's bin directory install(TARGETS cpsumon DESTINATION bin) # Optional: Add rules for config files, man pages, or other assets # install(FILES cpsumon.conf # DESTINATION etc)
If these lines are missing, add them. Without them, CMake will never generate the install rule that BitBake is trying to execute.
2. Validate Your BitBake Recipe (.bb File) Configuration
OpenEmbedded's cmake class handles most of the build pipeline, but misconfigurations can still break the install step:
- Ensure you inherit the cmake class: Your recipe must include
inherit cmake—this sets up defaultdo_compileanddo_installtasks tailored for CMake projects. - Check
EXTRA_OECMAKE(if needed): If your project requires custom CMake flags (like setting a build type or enabling optional features), add them here. For example:EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" - Avoid overriding
do_installunnecessarily: If you've customized thedo_installtask, make sure it includesoe_runmake install(orcmake --build . --target install) to trigger the install step. The defaultcmakeclass handles this automatically, so only override it if you need extra post-install steps.
3. Test CMake Locally to Rule Out BitBake Variables
Before digging deeper into BitBake, confirm that CMake can generate a working Makefile with an install target on your local machine:
- Create a build directory in your cpsumon source tree:
mkdir build && cd build - Run CMake with the same flags you use in your recipe:
cmake .. [any extra flags from EXTRA_OECMAKE] - Check if the
installtarget exists in the generated Makefile:grep -A 10 "install:" Makefile
If the install target isn't present here, the problem is definitely in your CMakeLists.txt—go back to step 1 to fix that. If it does exist, the issue lies in your BitBake recipe configuration.
4. Example BitBake Recipe for Reference
Here's a minimal, working recipe template you can adapt for cpsumon:
SUMMARY = "Corsair AXi Series PSU Monitoring Tool" HOMEPAGE = "Project homepage here" LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=d41d8cd98f00b204e9800998ecf8427e" SRC_URI = "git://your-repo-url.git;branch=main" SRCREV = "your-latest-commit-hash" S = "${WORKDIR}/git" inherit cmake # Uncomment and adjust if you need custom CMake flags # EXTRA_OECMAKE = "-DCMAKE_INSTALL_PREFIX=${D}${prefix}"
内容的提问来源于stack exchange,提问作者Bernardo Rodrigues

