cmake_minimum_required(VERSION 3.14) project(test_fastmouse) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) cmake_policy(SET CMP0135 NEW) include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/refs/tags/v1.16.0.zip ) FetchContent_MakeAvailable(googletest) file (GLOB SOURCE_FILES CONFIGURE_DEPENDS "*.cc" ) add_executable(${PROJECT_NAME} ${SOURCE_FILES} ) target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common -Wconversion -Wpedantic -std=c++20 -O2 -Wno-exceptions -Wno-missing-field-initializers -Wno-unknown-pragmas ) target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest_main ) enable_testing() include(GoogleTest) gtest_discover_tests(test_fastmouse)