lfreist / hwinfo

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

feat: make hwinfo features modular #98

Closed aminya closed 4 months ago

aminya commented 4 months ago

Fixes #94 Related to #54

Implements https://github.com/lfreist/hwinfo/issues/94#issuecomment-2215053551

All components are available via the hwinfo::hwinfo target, or via individual CMake targets, which you can choose and link against depending on your needs.

target_link_libraries(your_target PRIVATE hwinfo::hwinfo)

or

target_link_libraries(
  your_target
  PRIVATE hwinfo::cpu
          hwinfo::gpu
          hwinfo::ram
          hwinfo::mainboard
          hwinfo::disk
          hwinfo::os
          hwinfo::battery)

The CMake options control which components will be built and available in the library: