Skip to content

Commit

Permalink
cmake: add imgui color text editor to project
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Sep 7, 2024
1 parent dac78db commit a932ac8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ set(HELLO_IMGUI_SOURCES
${HELLO_IMGUI_DIR}/imgui_theme.h
)

set(IMGUI_COLOR_TEXT_EDIT_DIR Quake/ImGuiColorTextEdit)
set(IMGUI_COLOR_TEXT_EDIT_SOURCES
${IMGUI_COLOR_TEXT_EDIT_DIR}/LanguageDefinitions.cpp
${IMGUI_COLOR_TEXT_EDIT_DIR}/TextEditor.cpp
${IMGUI_COLOR_TEXT_EDIT_DIR}/TextEditor.h
)

set(POSIX_SOURCES
Quake/net_bsd.c
Quake/net_udp.c
Expand Down Expand Up @@ -324,6 +331,7 @@ endif()

target_compile_definitions(${PROJECT_NAME} PRIVATE
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
IMGUI_EDITOR_NO_BOOST
USE_CODEC_UMX
USE_CODEC_WAVE
# USE_HELLO_IMGUI
Expand All @@ -343,6 +351,9 @@ if(MSVC)
set_source_files_properties(${LUA_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4267")
endif()

set_source_files_properties(${IMGUI_COLOR_TEXT_EDIT_DIR}/TextEditor.cpp
PROPERTIES COMPILE_FLAGS "/wd4018 /wd4244 /wd4267")

# Disable C++ exceptions and RTTI
# Altering of global CMAKE_CXX_FLAGS is required because the following line
# target_compile_options(${PROJECT_NAME} PRIVATE /EHs-c- /GR-)
Expand All @@ -367,6 +378,9 @@ else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-trigraphs)
set_source_files_properties(${IMGUI_DIR}/imgui.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-variable")

set_source_files_properties(${IMGUI_COLOR_TEXT_EDIT_DIR}/TextEditor.cpp
PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-sign-compare")

# Disable G++ format string truncation warning
# warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 28
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -484,13 +498,15 @@ set(ENGINE_SOURCES
source_group("Engine" FILES ${ENGINE_SOURCES} Quake/snd_mp3.c Quake/snd_mpg123.c)
source_group("Hello ImGui" FILES ${HELLO_IMGUI_SOURCES})
source_group("ImGui" FILES ${IMGUI_SOURCES})
source_group("ImGuiColorTextEdit" FILES ${IMGUI_COLOR_TEXT_EDIT_SOURCES})
source_group("Lua" FILES ${LUA_SOURCES})
source_group("TLSF" FILES ${TLSF_SOURCES})

target_sources(${PROJECT_NAME} PRIVATE
${ENGINE_SOURCES}
${HELLO_IMGUI_SOURCES}
${IMGUI_SOURCES}
${IMGUI_COLOR_TEXT_EDIT_SOURCES}
${LUA_SOURCES}
${TLSF_SOURCES}
)
Expand Down

0 comments on commit a932ac8

Please sign in to comment.