Skip to content

Instantly share code, notes, and snippets.

@itavero
Created September 14, 2022 16:57
Show Gist options
  • Save itavero/547a705fb2eaa50a6ee149577162ddb1 to your computer and use it in GitHub Desktop.
Save itavero/547a705fb2eaa50a6ee149577162ddb1 to your computer and use it in GitHub Desktop.
CppUTest (from apt-get) not found by CMake on Ubuntu
cmake_minimum_required(VERSION 3.14)
project(cpputest-via-apt-get
VERSION 1
LANGUAGES CXX)
find_package(CppUTest 4 REQUIRED)
FROM ubuntu:jammy
COPY CMakeLists.txt /testproject/
ENV CMAKE_MAKE_PROGRAM=ninja
ENV CMAKE_GENERATOR=Ninja
RUN apt-get update && \
apt-get install --no-install-recommends -y nano git cmake ninja-build cpputest gcc g++ ca-certificates && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt/archives && \
rm -rf /usr/share/doc/ && \
rm -rf /usr/share/man/ && \
rm -rf /usr/share/locale/ \
gcc --version && \
cmake --version && \
ninja --version && \
ls -hal /testproject/ && \
cmake -S /testproject -B /tmp/build
#6 40.21 -- The CXX compiler identification is GNU 11.2.0
#6 40.23 -- Detecting CXX compiler ABI info
#6 40.32 -- Detecting CXX compiler ABI info - done
#6 40.33 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#6 40.33 -- Detecting CXX compile features
#6 40.34 -- Detecting CXX compile features - done
#6 40.34 -- Configuring incomplete, errors occurred!
#6 40.34 See also "/tmp/build/CMakeFiles/CMakeOutput.log".
#6 40.35 CMake Error at /usr/lib/x86_64-linux-gnu/CppUTest/cmake/CppUTestConfig.cmake:11 (message):
#6 40.35 File or directory /usr/lib/include referenced by variable
#6 40.35 CppUTest_INCLUDE_DIRS does not exist !
#6 40.35 Call Stack (most recent call first):
#6 40.35 /usr/lib/x86_64-linux-gnu/CppUTest/cmake/CppUTestConfig.cmake:27 (set_and_check)
#6 40.35 CMakeLists.txt:7 (find_package)
@itavero
Copy link
Author

itavero commented Sep 14, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment