From 143fc1234de2aaa40a2f04b0fe42385240fd284a Mon Sep 17 00:00:00 2001 From: Rajesh Deshpande Date: Tue, 1 Oct 2024 16:24:34 -0700 Subject: [PATCH] test --- CMakeLists.txt | 24 ++++++++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 30 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9227c1d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.10) + +project(HelloWorld) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +enable_testing() + +find_package(fmt CONFIG REQUIRED) +find_package(GTest CONFIG REQUIRED) + +add_executable(HelloWorld helloworld.cpp) + +target_link_libraries(HelloWorld PRIVATE fmt::fmt) + +add_executable( + hello_test + hello_test.cc +) +target_link_libraries( + hello_test + GTest::gtest_main +) +include(GoogleTest) +gtest_discover_tests(hello_test) \ No newline at end of file diff --git a/README.md b/README.md index e69de29..8b86613 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,6 @@ +brew install ninja +vcpkg add port gtest +cmake --preset=default +cmake -S . -B build +cmake --build build +cd build && ctest