45 lines
1.1 KiB
CMake
45 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.22.1)
|
|
project("mosis-designer")
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Use FetchContent for RmlUi
|
|
include(FetchContent)
|
|
|
|
# Find Lua before RmlUi so it can be used
|
|
find_package(Lua REQUIRED)
|
|
|
|
# Enable RmlUi Lua bindings before fetching
|
|
set(RMLUI_LUA_BINDINGS ON CACHE BOOL "" FORCE)
|
|
|
|
# Fetch RmlUi from GitHub
|
|
FetchContent_Declare(
|
|
rmlui
|
|
GIT_REPOSITORY https://github.com/mikke89/RmlUi.git
|
|
GIT_TAG master
|
|
)
|
|
|
|
FetchContent_MakeAvailable(rmlui)
|
|
|
|
# Find other dependencies via vcpkg
|
|
find_package(glfw3 CONFIG REQUIRED)
|
|
find_package(freetype CONFIG REQUIRED)
|
|
|
|
# Get the RmlUi source directory for include paths
|
|
FetchContent_GetProperties(rmlui)
|
|
set(RMLUI_SOURCE_DIR ${rmlui_SOURCE_DIR})
|
|
|
|
add_executable(mosis-designer
|
|
main.cpp
|
|
${rmlui_SOURCE_DIR}/Backends/RmlUi_Backend_GLFW_GL3.cpp
|
|
${rmlui_SOURCE_DIR}/Backends/RmlUi_Platform_GLFW.cpp
|
|
${rmlui_SOURCE_DIR}/Backends/RmlUi_Renderer_GL3.cpp
|
|
)
|
|
target_link_libraries(mosis-designer PUBLIC
|
|
RmlUi::RmlUi RmlUi::Lua glfw freetype
|
|
)
|
|
target_include_directories(mosis-designer PUBLIC
|
|
${RMLUI_SOURCE_DIR}
|
|
${RMLUI_SOURCE_DIR}/Backends
|
|
) |