andre@1: # Copyright (C) 2016 by ETH Zürich andre@1: # Software engineering by Intevation GmbH andre@1: # andre@1: # This file is Free Software under the GNU GPL (v>=2) andre@1: # and comes with ABSOLUTELY NO WARRANTY! andre@1: # See LICENSE.txt for details. andre@1: andre@1: include_directories(${Qt5Core_INCLUDE_DIRS}) andre@1: andre@1: include_directories(${CMAKE_CURRENT_SOURCE_DIR}) andre@1: andre@1: add_subdirectory(xlsx) andre@1: include_directories(xlsx) andre@1: andre@1: set(APPLICATION_SRC andre@1: main.cpp andre@1: converter.cpp andre@1: strhelp.c andre@1: ) andre@1: andre@1: find_package(Qt5LinguistTools) andre@1: andre@1: if(Qt5LinguistTools_FOUND) andre@1: andre@1: set(FILES_TO_TRANSLATE andre@1: ${APPLICATION_SRC} andre@1: ) andre@1: andre@1: # Include translation as a resource andre@1: # This works in the source directory to enable the rcc dependencies to be found andre@1: # and it also updates the currently available localization. andre@1: configure_file(l10n/l10n.qrc.in l10n.qrc) andre@1: qt5_add_resources(APPLICATION_SRC ${CMAKE_CURRENT_BINARY_DIR}/l10n.qrc) andre@1: qt5_create_translation(TRANSLATION_SRC ${FILES_TO_TRANSLATE} andre@1: ${CMAKE_CURRENT_SOURCE_DIR}/l10n/main_de_DE.ts) andre@1: endif() andre@1: andre@1: andre@1: add_executable(${PROJECT_NAME} andre@1: ${_add_executable_params} andre@1: ${APPLICATION_SRC} andre@1: ${TRANSLATION_SRC} andre@1: ) andre@1: andre@1: target_link_libraries(${PROJECT_NAME} andre@1: Qt5::Core andre@1: Qt5::Gui andre@1: ${PROJECT_NAME}_libqtxslx andre@1: ) andre@1: andre@1: if (WIN32) andre@1: set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-municode") andre@1: endif(WIN32) andre@1: andre@1: install(TARGETS ${PROJECT_NAME} DESTINATION bin BUNDLE DESTINATION .) andre@1: andre@1: if(APPLE) andre@1: install(CODE " andre@1: include(BundleUtilities) andre@1: fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\") andre@1: " COMPONENT Runtime) andre@1: endif() andre@1: set(CPACK_BINARY_DRAGNDROP ON) andre@1: include(CPack)