Mercurial > clickerconvert
annotate src/CMakeLists.txt @ 14:256182eca5b6
Added tag 0.7 for changeset 101ee762f021
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 22 Mar 2016 17:25:20 +0100 |
parents | 7f26b0293e1d |
children | 0b66b10a287d |
rev | line source |
---|---|
1
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
1 # Copyright (C) 2016 by ETH Zürich |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
2 # Software engineering by Intevation GmbH |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
3 # |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
4 # This file is Free Software under the GNU GPL (v>=2) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
5 # and comes with ABSOLUTELY NO WARRANTY! |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
6 # See LICENSE.txt for details. |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
7 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
8 include_directories(${Qt5Core_INCLUDE_DIRS}) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
9 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
10 include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
11 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
12 add_subdirectory(xlsx) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
13 include_directories(xlsx) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
14 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
15 set(APPLICATION_SRC |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
16 main.cpp |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
17 converter.cpp |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
18 strhelp.c |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
19 ) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
20 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
21 find_package(Qt5LinguistTools) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
22 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
23 if(Qt5LinguistTools_FOUND) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
24 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
25 set(FILES_TO_TRANSLATE |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
26 ${APPLICATION_SRC} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
27 ) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
28 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
29 # Include translation as a resource |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
30 # This works in the source directory to enable the rcc dependencies to be found |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
31 # and it also updates the currently available localization. |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
32 configure_file(l10n/l10n.qrc.in l10n.qrc) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
33 qt5_add_resources(APPLICATION_SRC ${CMAKE_CURRENT_BINARY_DIR}/l10n.qrc) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
34 qt5_create_translation(TRANSLATION_SRC ${FILES_TO_TRANSLATE} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
35 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/main_de_DE.ts) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
36 endif() |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
37 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
38 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
39 add_executable(${PROJECT_NAME} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
40 ${_add_executable_params} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
41 ${APPLICATION_SRC} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
42 ${TRANSLATION_SRC} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
43 ) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
44 |
10
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
45 if (WIN32) |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
46 get_target_property(_loc Qt5::Widgets LOCATION) |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
47 get_filename_component(_qtpath ${_loc} PATH) |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
48 set(EXTRA_STATIC_LIBS |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
49 -L${_qtpath} |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
50 -lpcre16 |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
51 Qt5::QWindowsIntegrationPlugin |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
52 -lwinspool -lshlwapi |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
53 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
54 -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -lmstask -luuid -lws2_32 |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
55 -ladvapi32 -lshell32 -luser32 -lkernel32 ) |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
56 endif() |
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
57 |
1
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
58 target_link_libraries(${PROJECT_NAME} |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
59 Qt5::Core |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
60 Qt5::Gui |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
61 ${PROJECT_NAME}_libqtxslx |
10
7f26b0293e1d
Fix windows build
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1
diff
changeset
|
62 ${EXTRA_STATIC_LIBS} |
1
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
63 ) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
64 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
65 if (WIN32) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
66 set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-municode") |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
67 endif(WIN32) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
68 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
69 install(TARGETS ${PROJECT_NAME} DESTINATION bin BUNDLE DESTINATION .) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
70 |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
71 if(APPLE) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
72 install(CODE " |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
73 include(BundleUtilities) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
74 fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\") |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
75 " COMPONENT Runtime) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
76 endif() |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
77 set(CPACK_BINARY_DRAGNDROP ON) |
93d3106bb9a4
Add qt xlsx library
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
78 include(CPack) |