GildedRose-Refactoring-Kata/cpp/CMakeLists.txt
Jacob Mossberg 1836cca836 Refactor C++ version of the Gilded Rose kata
* Make it possible to build and run tests in CLion
  and Visual Studio 2019 out of the box

* Provide four types of initial test using different test frameworks:
  * Catch2 test framework
    * Traditional unit testing using Catch2
    * Approval test using Catch2
  * Google Test test framework
    * Traditional unit testing using Google Test
    * Approval test using Google Test

* The different types of initial test are located in separate folders
  in the test folder.

* Remove scripts to build and run tests and replace
  with instructions in the cpp README.md

* Use C++17

* Use CMake => 3.13
2019-12-09 08:40:47 +01:00

35 lines
958 B
CMake

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.8.1
)
# Fetch GoogleTest amd make build scripts available
if (NOT googletest_POPULATED)
FetchContent_Populate(googletest)
endif()
#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()
# Bring the populated content into the build
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
enable_testing()
add_subdirectory(src)
add_subdirectory(lib)
add_subdirectory(test)