cmake_minimum_required(VERSION 3.10) project(HidDeviceAnalyzer VERSION 1.0) # Set C++ standard set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Add source files set(SOURCES main.cpp hid_device_analyzer.cpp ) # Add header files set(HEADERS hid_device_analyzer.h ) # Create executable add_executable(hid_analyzer ${SOURCES} ${HEADERS}) # Platform-specific settings if(WIN32) # Windows-specific settings target_link_libraries(hid_analyzer setupapi hid) # Add Windows-specific compile definitions target_compile_definitions(hid_analyzer PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) elseif(UNIX AND NOT APPLE) # Linux-specific settings # You would need to add the appropriate libraries for Linux # For example: target_link_libraries(hid_analyzer udev) elseif(APPLE) # macOS-specific settings # You would need to add the appropriate libraries for macOS # For example: target_link_libraries(hid_analyzer "-framework IOKit" "-framework CoreFoundation") endif() # Installation install(TARGETS hid_analyzer DESTINATION bin) # Add a README.md file with build instructions configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/README.md @ONLY)