# Copyright (C) 2018 Intevation GmbH <info@intevation.de>
#
# This file is Free Software under the GNU GPL (v>=2)
# and comes with ABSOLUTELY NO WARRANTY!
# See LICENSE.txt for details.

set(EXECUTABLE_NAME "gpgolkeyadder")

set(EXECUTABLE_SRC
    main.cpp
    gpgolkeyadder-options.h
    gpgolkeyadder.cpp
    stdinreader.cpp
    ${CMAKE_SOURCE_DIR}/src/img/icon.rc
    ${CMAKE_SOURCE_DIR}/src/util/strhelp.c
    ${CMAKE_SOURCE_DIR}/src/util/w32-util.cpp
    ${CMAKE_SOURCE_DIR}/src/util/w32-qt-util.cpp
    ${CMAKE_SOURCE_DIR}/src/util/w32-gettext.c
)

qt_add_resources(EXECUTABLE_SRC gpgolkeyadder.qrc)

add_executable(${EXECUTABLE_NAME}
    ${_add_executable_params}
    ${EXECUTABLE_SRC}
)

target_link_libraries(${EXECUTABLE_NAME}
    Qt::Widgets
    Gpgmepp
)

if (WIN32)
   set_target_properties(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS "-municode")
endif(WIN32)

install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
