lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
434 stars 76 forks source link

Not succeeding in cmaking examples #99

Closed martinwguy closed 1 month ago

martinwguy commented 1 month ago

What a wonderful project, exactly what I needed. Many thanks.

However I'm not succeeding in making the example programs. I do:

mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Release  # -DNO_OCL=ON
cmake --build build
cmake --install build
cd examples
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Release  # -DNO_OCL=ON
cmake --build build

and get

hwinfo/examples/system_infoMain.cpp:5:10: fatal error: hwinfo/hwinfo.h: No such file or directory
    5 | #include <hwinfo/hwinfo.h>

I see it only installs /usr/local/include/fmt/*, not hwinfo.h

Is there something I'm missing here? (I'm new to cmake and am inventing the runes. Maybe document them, and --install, for us newbies?)

Blessings

M
lfreist commented 1 month ago

Hi, thank you for the report! I am currently restructuring the CMake part and it may be that the installation is not working properly at the moment.

I'll check on it later today.

However, you don't need to create a build directory in the examples directory. The build you did for the root project should contain the example executable. The first 3 lines you posted should be sufficient.

lfreist commented 1 month ago

Commit 82161e7bb5d65d5165d530140c3fc51036733a9d fixes installs using CMake. The executables are installed to /usr/local/bin on GNU Linux.