mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 10:33:53 +00:00
Restructure build targets of CMake configuration
* Rename the library under test from src to GildedRoseLib. * Move the lib folder to test/third_party and handle ApprovalTests.hpp as header-only dependency. * Remove the superfluous googletest_approval_main.cpp (in the same sense as there is only one GildedRoseCatch2ApprovalTests.cc) * Set USE_FOLDERS property such that target ALL_BUILD, RUN_TESTS and ZERO_CHECK are grouped for Visual Studio. * Set WORKING_DIRECTORY such that the RUN_TESTS target works successfully. * Fix C++ language standard for Catch2 v3 to C++14. * Bump third-party dependencies * Update ApprovalTests.hpp to v10.13.0 * Update Catch2 to v3.8.0 * Update GTest to v1.16.0
This commit is contained in:
1 parent
a9fe49d2b6
commit
3bf108ef0e
17 files changed
+6968
-3004
No files matched your search
+1
-27
@@ -1,37 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(gilded-rose-refactoring-kata-cpp)
|
||||
|
||||
# Load FetchContent module.
|
||||
include(FetchContent)
|
||||
|
||||
# Declare GoogleTest as the content to fetch
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.12.1
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.3.2
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(googletest catch2)
|
||||
|
||||
#set(gtest_force_shared_crt OFF CACHE BOOL "" FORCE)
|
||||
# Force Google Test to link the C/C++ runtimes dynamically when
|
||||
# building on Visual Studio
|
||||
# Link:
|
||||
# * https://github.com/google/googletest/tree/release-1.8.1/googletest#visual-studio-dynamic-vs-static-runtimes
|
||||
if (MSVC)
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# uncomment this line to enable coverage measurements using gcov
|
||||
# set(CMAKE_CXX_FLAGS "--coverage")
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(test)
|
||||
Reference in new issue
Block a user