diff src/CMakeLists.txt @ 1:93d3106bb9a4

Add qt xlsx library
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 22 Mar 2016 10:38:08 +0100
parents 49cd5cc0b072
children 7f26b0293e1d
line wrap: on
line diff
--- a/src/CMakeLists.txt	Mon Mar 07 17:35:09 2016 +0100
+++ b/src/CMakeLists.txt	Tue Mar 22 10:38:08 2016 +0100
@@ -0,0 +1,64 @@
+# Copyright (C) 2016 by ETH Zürich
+# Software engineering by Intevation GmbH
+#
+# This file is Free Software under the GNU GPL (v>=2)
+# and comes with ABSOLUTELY NO WARRANTY!
+# See LICENSE.txt for details.
+
+include_directories(${Qt5Core_INCLUDE_DIRS})
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_subdirectory(xlsx)
+include_directories(xlsx)
+
+set(APPLICATION_SRC
+    main.cpp
+    converter.cpp
+    strhelp.c
+)
+
+find_package(Qt5LinguistTools)
+
+if(Qt5LinguistTools_FOUND)
+
+    set(FILES_TO_TRANSLATE
+        ${APPLICATION_SRC}
+    )
+
+    # Include translation as a resource
+    # This works in the source directory to enable the rcc dependencies to be found
+    # and it also updates the currently available localization.
+    configure_file(l10n/l10n.qrc.in l10n.qrc)
+    qt5_add_resources(APPLICATION_SRC ${CMAKE_CURRENT_BINARY_DIR}/l10n.qrc)
+    qt5_create_translation(TRANSLATION_SRC ${FILES_TO_TRANSLATE}
+        ${CMAKE_CURRENT_SOURCE_DIR}/l10n/main_de_DE.ts)
+endif()
+
+
+add_executable(${PROJECT_NAME}
+    ${_add_executable_params}
+    ${APPLICATION_SRC}
+    ${TRANSLATION_SRC}
+)
+
+target_link_libraries(${PROJECT_NAME}
+    Qt5::Core
+    Qt5::Gui
+    ${PROJECT_NAME}_libqtxslx
+)
+
+if (WIN32)
+   set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-municode")
+endif(WIN32)
+
+install(TARGETS ${PROJECT_NAME} DESTINATION bin BUNDLE DESTINATION .)
+
+if(APPLE)
+   install(CODE "
+       include(BundleUtilities)
+       fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
+       " COMPONENT Runtime)
+endif()
+set(CPACK_BINARY_DRAGNDROP ON)
+include(CPack)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)