-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (61 loc) · 1.67 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 3.8.2)
project(game-of-life-cpp
LANGUAGES CXX
VERSION 1.0
)
set(CMAKE_BUILD_TYPE Release)
# Caching
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
endif(CCACHE_FOUND)
# Dependencies
include(FetchContent)
set(SFML_BUILD_AUDIO FALSE)
set(SFML_BUILD_NETWORK FALSE)
if (CMAKE_CXX_COMPILER MATCHES ".*icpx.*")
elseif (CMAKE_CXX_COMPILER MATCHES ".*icpc.*")
# Need to install SFML manually when using Intel compiler,
# because I haven't bothered figuring out how to compile SFML separately with GCC
else()
FetchContent_Declare(
sfml
GIT_REPOSITORY "https://github.com/SFML/SFML.git"
GIT_TAG "2.5.1"
)
FetchContent_MakeAvailable(sfml)
endif()
FetchContent_Declare(
imgui
GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
GIT_TAG "35b1148efb839381b84de9290d9caf0b66ad7d03"
)
FetchContent_MakeAvailable(imgui)
set(IMGUI_DIR ${imgui_SOURCE_DIR})
set(IMGUI_SFML_FIND_SFML OFF)
set(IMGUI_SFML_IMGUI_DEMO OFF)
FetchContent_Declare(
imgui-sfml
GIT_REPOSITORY "https://github.com/eliasdaler/imgui-sfml.git"
GIT_TAG "82dc2033e51b8323857c3ae1cf1f458b3a933c35"
)
FetchContent_MakeAvailable(imgui-sfml)
FetchContent_Declare(
Catch2
GIT_REPOSITORY "https://github.com/catchorg/Catch2.git"
GIT_TAG "v2.13.8"
)
FetchContent_MakeAvailable(Catch2)
FetchContent_Declare(
googletest
GIT_REPOSITORY "https://github.com/google/googletest.git"
GIT_TAG "v1.10.x"
)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY "https://github.com/google/benchmark.git"
GIT_TAG "v1.6.1"
)
FetchContent_MakeAvailable(googlebenchmark)
add_subdirectory(src)