generated from COP3530/P3-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (34 loc) · 1.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.22)
project(SteamAnalyzer)
set(CMAKE_CXX_STANDARD 14)
#compile flags to match Gradescope test environment
set(GCC_COVERAGE_COMPILE_FLAGS " -Werror") # remove -Wall if you don't want as many warnings treated as errors
# gradescope does use -Werror, so if you remove it here you may run into issues when trying to submit
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
##pull in desired version of catch through cmake automatically, make it available
Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.2 # if you run into issues, try updating your editor or downgrading to a lower version of catch v3
)
FetchContent_MakeAvailable(Catch2)
include_directories(src)
add_executable(Main
src/main.cpp # your main file
src/gameObject.h src/gameObject.cpp
src/hashMap.h src/hashMap.cpp
src/rbTree.h src/rbTree.cpp
)
# These tests can use the Catch2-provided main
add_executable(Tests
test/test.cpp # your test file
src/gameObject.h src/gameObject.cpp
src/hashMap.h src/hashMap.cpp
)
target_link_libraries(Tests PRIVATE Catch2::Catch2WithMain) #link catch to test.cpp file
# the name here must match that of your testing executable (the one that has test.cpp)
# comment everything below out if you are using CLion
#include(CTest)
#include(Catch)
#catch_discover_tests(Tests) # must be named the same as your test executable