From c81b4d213ecc29366ab281f76068c6f8b6181c85 Mon Sep 17 00:00:00 2001 From: Eero Holmala Date: Mon, 17 Apr 2023 16:50:30 +0300 Subject: [PATCH] start test cmakelists.txt for app --- App/Docs/NOTES.md | 5 +++++ App/Tests/CMakeLists.txt | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 App/Docs/NOTES.md create mode 100644 App/Tests/CMakeLists.txt diff --git a/App/Docs/NOTES.md b/App/Docs/NOTES.md new file mode 100644 index 0000000..40e4707 --- /dev/null +++ b/App/Docs/NOTES.md @@ -0,0 +1,5 @@ +# My Notes + +## Notes + +Add tests for when you start implementing the AppLib functions. Use gtest for that. Also if you can figure it out (i know you can) add some file movement to build dir automation for cmake. \ No newline at end of file diff --git a/App/Tests/CMakeLists.txt b/App/Tests/CMakeLists.txt new file mode 100644 index 0000000..6cd755f --- /dev/null +++ b/App/Tests/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required (VERSION 3.8) + +# Add source to this project's executable. + +file(GLOB SRCS "src/*.cpp") +file(GLOB_RECURSE HDRS "include/*.hh") + + +add_library(AppLib + ${SRCS} + ${HDRS} +) + +target_include_directories(AppLib PUBLIC "${CMAKE_SOURCE_DIR}/AppLib/include/AppLib") + +enable_testing() + +find_package(GTest CONFIG REQUIRED) +target_link_libraries(AppTest PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main) + +add_test(AllTestsInMain AppTest) + +if (CMAKE_VERSION VERSION_GREATER 3.12) + set_property(TARGET AppLib PROPERTY CXX_STANDARD 20) +endif()