mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-06 17:09:06 +01:00
187 lines
4.2 KiB
CMake
187 lines
4.2 KiB
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(STORY_EDITOR_PROJECT story-editor)
|
|
|
|
project(${STORY_EDITOR_PROJECT} LANGUAGES C CXX)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
set (CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# set(CMAKE_VERBOSE_MAKEFILE on)
|
|
|
|
|
|
if (MSVC)
|
|
add_compile_options("/FS")
|
|
endif (MSVC)
|
|
|
|
|
|
if(POLICY CMP0072)
|
|
cmake_policy(SET CMP0072 NEW)
|
|
endif()
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
set(IMGUI_VERSION 1.89.9)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(imgui
|
|
URL https://github.com/ocornut/imgui/archive/refs/tags/v${IMGUI_VERSION}-docking.zip
|
|
)
|
|
|
|
|
|
FetchContent_GetProperties(imgui)
|
|
if (NOT imgui_POPULATED) # Have we downloaded raylib yet?
|
|
set(FETCHCONTENT_QUIET NO)
|
|
FetchContent_Populate(imgui)
|
|
endif()
|
|
|
|
|
|
|
|
#=========================================================================================================================
|
|
# SDL3
|
|
#=========================================================================================================================
|
|
include(FetchContent)
|
|
Set(FETCHCONTENT_QUIET FALSE)
|
|
|
|
FetchContent_Declare(
|
|
SDL3
|
|
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
|
GIT_TAG origin/main
|
|
GIT_SHALLOW TRUE
|
|
GIT_PROGRESS TRUE
|
|
)
|
|
|
|
set(BUILD_SHARED_LIBS TRUE)
|
|
set(SDL_STATIC TRUE)
|
|
FetchContent_MakeAvailable(SDL3)
|
|
|
|
#=========================================================================================================================
|
|
# SDL3-Image
|
|
#=========================================================================================================================
|
|
FetchContent_Declare(
|
|
SDL2_image
|
|
GIT_REPOSITORY https://github.com/libsdl-org/SDL_image.git
|
|
GIT_TAG origin/main
|
|
GIT_SHALLOW TRUE
|
|
GIT_PROGRESS TRUE
|
|
)
|
|
|
|
# START ADDITION
|
|
set(SDL2IMAGE_INSTALL OFF)
|
|
set(BUILD_SHARED_LIBS FALSE)
|
|
# END ADDITION
|
|
|
|
FetchContent_MakeAvailable(SDL2_image)
|
|
|
|
|
|
set(SRCS
|
|
|
|
src/main.cpp
|
|
src/window_base.h
|
|
src/ConsoleWindow.cpp
|
|
src/ConsoleWindow.h
|
|
|
|
src/ImageWindow.cpp
|
|
src/ImageWindow.h
|
|
|
|
src/main_window.cpp
|
|
src/main_window.h
|
|
|
|
src/node_editor_window.cpp
|
|
src/node_editor_window.h
|
|
|
|
src/media_node.h
|
|
src/media_node.cpp
|
|
|
|
src/base_node.h
|
|
src/base_node.cpp
|
|
|
|
src/resources_window.cpp
|
|
src/resources_window.h
|
|
|
|
src/Gui.h
|
|
src/Gui.cpp
|
|
|
|
src/CodeEditor.cpp
|
|
src/CodeEditor.h
|
|
|
|
libs/ImGuiColorTextEdit/TextEditor.cpp
|
|
libs/ImGuiColorTextEdit/TextEditor.h
|
|
libs/imgui-node-editor/imgui_node_editor.cpp
|
|
libs/imgui-node-editor/imgui_canvas.cpp
|
|
libs/imgui-node-editor/imgui_node_editor_api.cpp
|
|
libs/imgui-node-editor/crude_json.cpp
|
|
libs/ImGuiFileDialog/ImGuiFileDialog.cpp
|
|
|
|
${imgui_SOURCE_DIR}/backends/imgui_impl_sdl3.cpp
|
|
${imgui_SOURCE_DIR}/backends/imgui_impl_sdlrenderer3.cpp
|
|
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
|
|
${imgui_SOURCE_DIR}/imgui.cpp
|
|
${imgui_SOURCE_DIR}/imgui_widgets.cpp
|
|
${imgui_SOURCE_DIR}/imgui_tables.cpp
|
|
${imgui_SOURCE_DIR}/imgui_draw.cpp
|
|
|
|
|
|
../software/chip32/chip32_assembler.cpp
|
|
../software/chip32/chip32_vm.c
|
|
../software/library/miniaudio.c
|
|
../software/library/miniaudio.h
|
|
|
|
src/story_project.cpp
|
|
src/media_converter.cpp
|
|
)
|
|
|
|
if(WIN32)
|
|
list(APPEND
|
|
SRCS
|
|
manolab/icon.rc
|
|
)
|
|
endif()
|
|
|
|
add_executable(${STORY_EDITOR_PROJECT}
|
|
${SRCS}
|
|
)
|
|
|
|
target_include_directories(${STORY_EDITOR_PROJECT} PUBLIC
|
|
${imgui_SOURCE_DIR}
|
|
${sdl3_SOURCE_DIR}/include
|
|
libs/ImGuiColorTextEdit/
|
|
${imgui_SOURCE_DIR}/backends
|
|
libs/ImGuiFileDialog
|
|
libs/imgui-node-editor
|
|
|
|
../software/library/
|
|
../software/chip32/
|
|
)
|
|
|
|
|
|
add_definitions(-DIMGUI_USE_WCHAR32)
|
|
add_link_options(-static-libgcc -static-libstdc++)
|
|
|
|
target_compile_definitions(${STORY_EDITOR_PROJECT} PUBLIC cimg_display=0)
|
|
|
|
target_link_directories(${STORY_EDITOR_PROJECT} PUBLIC ${sdl3_BINARY_DIR})
|
|
message(${sdl3_BINARY_DIR})
|
|
if (UNIX)
|
|
target_link_libraries(${STORY_EDITOR_PROJECT}
|
|
pthread
|
|
udev
|
|
glfw
|
|
OpenGL::GL
|
|
dl
|
|
SDL3
|
|
)
|
|
elseif(WIN32)
|
|
target_link_libraries(${STORY_EDITOR_PROJECT}
|
|
icl
|
|
OpenGL::GL
|
|
ws2_32.lib psapi.lib setupapi.lib cfgmgr32.lib advapi32.lib Dbghelp.lib
|
|
)
|
|
set_target_properties(${STORY_EDITOR_PROJECT} PROPERTIES
|
|
LINK_FLAGS /SUBSYSTEM:CONSOLE
|
|
)
|
|
endif()
|
|
|