# qwfassoc-standalone: executable that uses the qwfassoc library to reproduce
# the original tabbed wfassoc configurator.

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(QWFASSOC_STANDALONE_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main_window.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/manifest_parser.cpp"
)

set(QWFASSOC_STANDALONE_HEADERS
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main_window.h"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/manifest_parser.h"
)

set(QWFASSOC_STANDALONE_UI
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main_window.ui"
)

add_executable(qwfassoc-standalone WIN32
    ${QWFASSOC_STANDALONE_SOURCES}
    ${QWFASSOC_STANDALONE_HEADERS}
    ${QWFASSOC_STANDALONE_UI}
)

target_include_directories(qwfassoc-standalone PRIVATE
    "${CMAKE_CURRENT_SOURCE_DIR}/src"
)

target_link_libraries(qwfassoc-standalone PRIVATE
    qwfassoc
    Qt6::Widgets
    toml11::toml11
)

# Translation pipeline for the standalone executable. The library's strings
# are translated by qwfassoc's own .ts file; this one only covers the
# executable-specific messages (CLI errors, tab titles, etc.).
set(QWFASSOC_STANDALONE_TS_FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/i18n/qwfassoc-standalone_zh_CN.ts"
)

qt6_add_translations(qwfassoc-standalone
    TS_FILES ${QWFASSOC_STANDALONE_TS_FILES}
)
