-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
45 lines (36 loc) · 1.17 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
include(FetchContent)
set(SFML_VERSION 2.5.1)
set(IMGUI_VERSION 1.87)
# set(IMGUI_SFML_VERSION 2.3)
# It's nice to get stripped-down release zips instead of cloning
# a repo and checking out a tag
FetchContent_Declare(
SFML
URL "/~https://github.com/SFML/SFML/archive/${SFML_VERSION}.zip"
)
FetchContent_Declare(
imgui
URL "/~https://github.com/ocornut/imgui/archive/v${IMGUI_VERSION}.zip"
)
# Or by tag...
FetchContent_Declare(
imgui-sfml
GIT_REPOSITORY /~https://github.com/SFML/imgui-sfml.git
GIT_TAG 2.6.x
# GIT_COMMIT 5f54b69b6aee18db846c81633f86f78c2586dded
# ^ or like this - sometimes it's better because FetchContent won't look
# into remote to see if branch head was updated or not - good for stable
# tags like 'vX.X' corresponding to releases
)
## finally, let's build
# SFML
option(SFML_BUILD_AUDIO "Build audio" OFF)
option(SFML_BUILD_NETWORK "Build network" OFF)
FetchContent_MakeAvailable(sfml)
# Dear ImGui
FetchContent_MakeAvailable(imgui)
# ImGui-SFML
set(IMGUI_DIR ${imgui_SOURCE_DIR})
option(IMGUI_SFML_FIND_SFML "Use find_package to find SFML" OFF)
option(IMGUI_SFML_IMGUI_DEMO "Build imgui_demo.cpp" ON)
FetchContent_MakeAvailable(imgui-sfml)