forked from ocornut/imgui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (56 loc) · 2.33 KB
/
CMakeLists.txt
File metadata and controls
62 lines (56 loc) · 2.33 KB
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
################################################################################
cmake_minimum_required(VERSION 3.13)
project(imgui)
cmake_policy(SET CMP0077 NEW)
###############################################################################
if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif ()
if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif ()
if (NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif ()
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 23)
endif ()
###############################################################################
# Warnings
###############################################################################
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wall -Wextra -Wunused-parameter -Wformat -Wnarrowing -Wno-sign-conversion -Wno-error=declaration-after-statement) # $<$<COMPILE_LANGUAGE:CXX>:-pedantic>
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wnontrivial-memaccess)
endif ()
if (NOT APPLE)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-copy>)
endif ()
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wshadow)
endif ()
project(imgui)
set(IMGUI_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#
file(GLOB sources *.cpp)
file(GLOB headers *.h)
message(STATUS "IMGUI_DIR: ${IMGUI_DIR}")
message(STATUS "sources: ${sources}")
add_library(imgui SHARED)
target_include_directories(imgui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(imgui PRIVATE ${sources} misc/cpp/imgui_stdlib.cpp)
################################################################################
# HBUI
################################################################################
#add_subdirectory(HBUI)
###############################################################################
# EXAMPLE
###############################################################################
option(HBUI_BUILD_EXAMPLE "Build example" OFF)
if(HBUI_BUILD_EXAMPLE)
set(IMVK_DOWNLOAD_GLFW ON)
add_subdirectory(HBUI)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/example/ ${CMAKE_BINARY_DIR}/example)
target_link_libraries(ImVk-example PRIVATE HBUI)
endif()