cmake_minimum_required(VERSION 3.24)
project(JfgFrontend LANGUAGES C CXX RC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(JFG_UI_NATIVE_ONLY ON)
add_subdirectory(../ui ui)
add_executable(RGO-Launcher WIN32 ../../src/app/frontend_win32.cpp)
target_compile_features(RGO-Launcher PRIVATE cxx_std_20)
target_compile_definitions(RGO-Launcher PRIVATE UNICODE _UNICODE)
target_include_directories(RGO-Launcher PRIVATE ../../include)
target_link_libraries(RGO-Launcher PRIVATE user32 gdi32 shell32 ole32 comdlg32)
if(MSVC)
 target_compile_options(RGO-Launcher PRIVATE /W4 /WX /utf-8)
 target_link_options(RGO-Launcher PRIVATE /DEBUG:NONE /INCREMENTAL:NO)
 set_property(TARGET RGO-Launcher PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
endif()
if(JFG_FRONTEND_HELPER)
 file(TO_CMAKE_PATH "${JFG_FRONTEND_HELPER}" helper_path)
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/helper.rc" "101 RCDATA \"${helper_path}\"\n")
 target_sources(RGO-Launcher PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/helper.rc")
endif()

target_sources(RGO-Launcher PRIVATE "${JFG_UI_RESOURCE}")
target_link_libraries(RGO-Launcher PRIVATE jfg_frontend_ui)
target_compile_definitions(RGO-Launcher PRIVATE JFG_RML_UI)
