annotate src/CMakeLists.txt @ 22:0a08c1c2531a 0.0.2

Fix missing include and update translations accordingly
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 14 Apr 2015 18:58:16 +0200
parents e3c8f61e45a9
children 64a51a42c01f
rev   line source
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 # Copyright (C) 2014 by Intevation GmbH
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 #
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 # This file is Free Software under the GNU GPL (v>=2)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 # and comes with ABSOLUTELY NO WARRANTY!
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 # See LICENSE.txt for details.
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 include_directories(${Qt5Widgets_INCLUDE_DIRS})
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
1
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
10 include_directories(libqxt)
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 add_definitions(${Qt5Widgets_DEFINITIONS})
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 set(APPLICATION_SRC
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 main.cpp
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 mainwindow.cpp
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 strhelp.c
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18 util_win.c
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 util_linux.c
2
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1
diff changeset
20 metadataview.cpp
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1
diff changeset
21 pngplayer.cpp
3
248d5d1cdb38 Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
22 imagelabel.cpp
4
e4748da7140b Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents: 3
diff changeset
23 filterwidget.cpp
9
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 4
diff changeset
24 folderselectdialog.cpp
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 )
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 find_package(Qt5LinguistTools)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 if(UNIX)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 # See: https://bugreports.qt-project.org/browse/QTBUG-35918
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 # XCB_EXTRA_LIBS should be gotten automatically.
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32 # The following list is taken from the .pri file
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 get_target_property(_loc Qt5::Widgets LOCATION)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 get_filename_component(_qtpath ${_loc} PATH)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 set(XCB_EXTRA_LIBS
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 -L${_qtpath}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 -lQt5DBus -lQt5Gui -lQt5Core -lQt5PlatformSupport
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 -lX11 -lX11-xcb -lxcb
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 -lXrender -lSM -lICE -ldbus-1
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 -lm -ldl -lrt -lpthread )
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 elseif(WIN32)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 set (_add_executable_params WIN32)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 get_target_property(_loc Qt5::Widgets LOCATION)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47 get_filename_component(_qtpath ${_loc} PATH)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 set(WINDOWS_EXTRA_LIBS
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 -L${_qtpath}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50 -lwinspool -lshlwapi
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
51 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
52 -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -lmstask -luuid -lws2_32
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
53 -ladvapi32 -lshell32 -luser32 -lkernel32 -lpcre16 -lz)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
54
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
55 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS})
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
56 endif()
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
57
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
58 set(QT_RESOURCES
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
59 ${CMAKE_CURRENT_SOURCE_DIR}/fonts.qrc
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
60 # ${CMAKE_SOURCE_DIR}/img/icons.qrc
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
61 )
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
62
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
63 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
64 qt5_add_resources(APPLICATION_SRC ${QT_RESOURCES})
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
65
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
66 if(Qt5LinguistTools_FOUND)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
67
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
68 set(FILES_TO_TRANSLATE
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
69 ${APPLICATION_SRC}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
70 )
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
71
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
72 # Include translation as a resource
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
73 # This works in the source directory to enable the rcc dependencies to be found
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
74 # and it also updates the currently available localization.
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
75 configure_file(l10n/l10n.qrc.in l10n.qrc)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
76 qt5_add_resources(APPLICATION_SRC ${CMAKE_CURRENT_BINARY_DIR}/l10n.qrc)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
77 qt5_create_translation(TRANSLATION_SRC ${FILES_TO_TRANSLATE}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
78 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/main_de_DE.ts)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
79 endif()
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
80
1
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
81 add_subdirectory(libqxt)
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
82
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
83 add_executable(${PROJECT_NAME}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
84 ${_add_executable_params}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
85 # ${IMG_SRC}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
86 ${APPLICATION_SRC}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
87 ${TRANSLATION_SRC}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
88 # ${CMAKE_SOURCE_DIR}/img/icon.rc
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
89 )
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
90
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
91
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
92 target_link_libraries(${PROJECT_NAME}
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
93 Qt5::Widgets
1
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
94 ${EXTRA_STATIC_LIBS}
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
95 ${PROJECT_NAME}_libqxt
7a2637c3eb83 Add csv parser from libqxt
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
96 )
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
97
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
98 if (WIN32)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
99 set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-municode")
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
100 endif(WIN32)
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
101
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
102 install(TARGETS ${PROJECT_NAME} DESTINATION bin)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)