forked from pthom/hello_imgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (47 loc) · 1.84 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
if (EMSCRIPTEN)
cmake_minimum_required(VERSION 3.13) # emscripten uses target_link_options (cmake 3.13+)
else()
cmake_minimum_required(VERSION 3.10)
endif()
project(HelloImGui LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
#
# Available backends: you need to select at least one of them!
#
option(HELLOIMGUI_USE_SDL_OPENGL3 "Build HelloImGui for SDL+OpenGL3" OFF)
option(HELLOIMGUI_USE_GLFW_OPENGL3 "Build HelloImGui for GLFW+OpenGL3" OFF)
option(HELLOIMGUI_USE_QT "Build HelloImGui for Qt" OFF)
option(HELLOIMGUI_USE_SDL_DIRECTX11 "Build HelloImGui for SDL+DirectX11" OFF)
option(HELLOIMGUI_CREATE_ANDROID_STUDIO_PROJECT "Create Android studio projects in build dir" OFF)
if (IOS OR EMSCRIPTEN)
set(need_opengl_loader OFF)
else()
set(need_opengl_loader ON)
endif()
option(HELLOIMGUI_USE_GLAD "Use Glad OpenGl loader" ${need_opengl_loader})
#
# Build options
#
option(HELLOIMGUI_BUILD_DOCS "Build docs" OFF)
option(HELLOIMGUI_BUILD_IMGUI "Use imgui sources provided in external/imgui" ON)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
option(HELLOIMGUI_BUILD_DEMOS "Build demos" ON)
else()
option(HELLOIMGUI_BUILD_DEMOS "Build demos" OFF)
endif()
set(HELLOIMGUI_BASEPATH ${CMAKE_CURRENT_LIST_DIR} CACHE STRING "Hello imgui base path" FORCE)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}/cmake/")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${HELLOIMGUI_BASEPATH}/hello_imgui_cmake/")
include(StandardProjectSettings)
include(StaticAnalyzers)
if (EMSCRIPTEN)
include(${HELLOIMGUI_BASEPATH}/hello_imgui_cmake/emscripten/hello_imgui_emscripten_global_options.cmake)
endif()
add_subdirectory(external)
add_subdirectory(src)
if (HELLOIMGUI_BUILD_DOCS)
add_custom_target(hello_imgui_build_doc ALL
${CMAKE_SOURCE_DIR}/tools/doc/process_md_docs.py
COMMENT "Generating md doc files"
)
endif()