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@21: cconvert_options.h 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@10: if (WIN32) andre@10: get_target_property(_loc Qt5::Widgets LOCATION) andre@10: get_filename_component(_qtpath ${_loc} PATH) andre@10: set(EXTRA_STATIC_LIBS andre@10: -L${_qtpath} andre@10: Qt5::QWindowsIntegrationPlugin andre@10: -lwinspool -lshlwapi andre@10: -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm andre@10: -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -lmstask -luuid -lws2_32 andre@33: -ladvapi32 -lshell32 -luser32 -lkernel32 -lqtfreetype -lqtharfbuzzng -lpcre16) andre@10: endif() andre@10: andre@1: target_link_libraries(${PROJECT_NAME} andre@23: Qt5::Widgets andre@23: Qt5::PrintSupport andre@1: ${PROJECT_NAME}_libqtxslx andre@10: ${EXTRA_STATIC_LIBS} 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)