-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
86 lines (68 loc) · 2.36 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.7)
project(vsgImGui
VERSION 0.6.0
DESCRIPTION "VulkanSceneGraph, ImGui and ImPlot integration library"
LANGUAGES CXX
)
set(VSGIMGUI_SOVERSION 0)
SET(VSGIMGUI_RELEASE_CANDIDATE 0)
set(VSGIMGUI_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Root source directory of vsgImGui")
set(VSGIMGUI_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "Root binary directory of vsgImGui")
# set the use of C++17 globally as all examples require it
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(vsgImGuiMacros)
# Find Vulkan and the VSG
if (VULKAN_SDK)
set(ENV{VULKAN_SDK} ${VULKAN_SDK})
endif()
find_package(vsg 1.0.5)
vsg_setup_dir_vars()
vsg_setup_build_vars()
if ( (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.h) OR
(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/implot/implot.h) )
find_package(Git QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
vsg_copy_imgui_headers(
FILES
${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui.h
${VSGIMGUI_SOURCE_DIR}/src/imgui/imconfig.h
${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui_internal.h
${VSGIMGUI_SOURCE_DIR}/src/imgui/imstb_textedit.h
${VSGIMGUI_SOURCE_DIR}/src/imgui//misc/cpp/imgui_stdlib.h
${VSGIMGUI_SOURCE_DIR}/src/implot/implot.h
${VSGIMGUI_SOURCE_DIR}/src/implot/implot_internal.h
)
vsg_add_target_clang_format(
FILES
include/vsgImGui/RenderImGui.h
include/vsgImGui/SendEventsToImGui.h
include/vsgImGui/Texture.h
src/vsgImGui/*.cpp
)
vsg_add_target_clobber()
vsg_add_target_cppcheck(
FILES
include/vsgImGui/*.h
src/vsgImGui/*.cpp
)
vsg_add_target_docs(
FILES
include
)
vsg_add_target_uninstall()
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
vsg_add_option_maintainer(
PREFIX v
RCLEVEL ${VSGIMGUI_RELEASE_CANDIDATE}
)
endif()
# source directory for main vsgImGui library
add_subdirectory(src)
vsg_add_feature_summary()