source: branches/release-0.3.0-rc1/src/mediadb/CMakeLists.txt @ 195

Last change on this file since 195 was 195, checked in by Joachim Langenbach, 11 years ago
  • refs #84
  • qt4_qhcp.cmake
    • macro to compile qhcp to qch files during configure
  • CMakeLists.txt (all folders)
    • add support for different languages (user can decide which languages he wants to build)
  • doc/app/CMakeLists.txt
    • Add german manual
  • doc/app/man
    • Improved mediadb.5
    • created mediadb.de.5
  • doc/app/manual/manual2html
    • improved the script, it now produces all needed outputs
      • PDF
      • HTML
      • QHCP (and therefore qhp files)
  • SettingsGeneral?
    • added an option to select default language
  • HelpCenter?
    • class starts the QtAssistant? with our qch file in choosen language
File size: 3.7 KB
Line 
1SET(QT_USE_QTSQL TRUE)
2
3IF(L10N_DE)
4        SET(mediadb_TS  ${mediadb_TS} lang/mediadb_de.ts)
5ENDIF(L10N_DE)
6
7SET(mediadb_QRC
8  mediadb.qrc
9        iconset.qrc
10)
11
12SET(mediadb_UI
13  mediendb.ui
14  setupwizard.ui
15  modulestate.ui
16  resultsummary.ui
17  searchwidget.ui
18        settingsdialog.ui
19        settingsgeneral.ui
20        insertmanualmediums.ui
21        projects.ui
22        about.ui
23)
24
25SET(mediadb_CPP
26  main.cpp
27  mediendb.cpp
28  setupwizard.cpp
29  dbinit.cpp
30  setupuserwidget.cpp
31  setupuser.cpp
32  modulelistwidgetitem.cpp
33  modulestate.cpp
34  resultsummary.cpp
35  searchwidget.cpp
36        settingsdialog.cpp
37        settingsgeneral.cpp
38        shoppingcart.cpp
39        shoppingcartlistview.cpp
40        insertmanualmediums.cpp
41        summary.cpp
42        loansummary.cpp
43        statisticssummary.cpp
44        projects.cpp
45        project.cpp
46        projectsmodel.cpp
47        about.cpp
48        helpcenter.cpp
49        mediadb.rc
50)
51
52INCLUDE_DIRECTORIES(
53  ${QT_INCLUDES}
54  ${mediadblib_SOURCE_DIR}
55  ${mediadblib_BINARY_DIR}
56  ${CMAKE_CURRENT_BINARY_DIR}
57        ${CMAKE_CURRENT_SOURCE_DIR}
58)
59INCLUDE(${QT_USE_FILE})
60LINK_DIRECTORIES(${mediadblib_SOURCE_DIR})
61
62IF(WIN32)
63  SET(SHAREDIR ".")
64ELSE(WIN32)       
65  SET(SHAREDIR ${share_DIR})
66ENDIF(WIN32)         
67SET(VERSION "${${PROJECT_NAME}_VERSION}")
68CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mediadbconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/mediadbconfig.h)
69CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/MediaDB.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/MediaDB.desktop)
70
71ADD_DEFINITIONS(${QT_DEFINITIONS})
72
73# QT4_WRAP_CPP(mediadb_MOCCED_H ${mediadb_MOC_H})
74QT4_AUTOMOC(${mediadb_CPP})
75
76QT4_WRAP_UI(mediadb_UI_H ${mediadb_UI})
77
78QT4_ADD_TRANSLATION(mediadb_TRANS ${mediadb_TS})
79
80QT4_ADD_RESOURCES(mediadb_RCCS ${mediadb_QRC})
81
82# needed to compile the icon into the exe file
83# the MINGW part is a workaround, since mingw can not handle the rc file
84# (msvc can handle it)
85IF(WIN32)
86        IF( MINGW )
87                # resource compilation for MinGW
88                ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mediadbico.o
89                                                                                                COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/mediadb.rc
90                                                                                                                 -o ${CMAKE_CURRENT_BINARY_DIR}/mediadbico.o )
91                SET(mediadb_CPP ${mediadb_CPP} ${CMAKE_CURRENT_BINARY_DIR}/mediadbico.o)
92        ELSE( MINGW )
93                SET(mediadb_CPP ${mediadb_CPP} mediadb.rc)
94        ENDIF( MINGW )
95ENDIF(WIN32)
96
97
98SET(neededStuff
99  ${mediadb_CPP}
100  ${mediadb_UI_H}
101  ${mediadb_TRANS}
102        ${mediadb_RCCS}
103)
104
105IF(UNIX)
106  ADD_EXECUTABLE(mediadb ${neededStuff})
107ELSEIF(APPLE)
108  # it's with gui, so MACOSX_BUNDLE is needed
109  ADD_EXECUTABLE(mediadb MACOSX_BUNDLE ${neededStuff})
110ELSEIF(WIN32)
111  # it's with gui, so WIN32 is needed
112  ADD_EXECUTABLE(mediadb WIN32 ${neededStuff})
113
114        IF(MINGW)
115                SET_TARGET_PROPERTIES(mediadb
116                        PROPERTIES LINK_FLAGS "-Wl,--enable-auto-import,--enable-runtime-pseudo-reloc"
117                        ENABLE_EXPORTS ON)
118        ENDIF(MINGW)
119ENDIF()
120
121TARGET_LINK_LIBRARIES(mediadb
122  ${QT_LIBRARIES}
123  mediadblib
124)
125
126# The COMPONENT option only defines the internal belonging of the INSTALL'ed thing
127INSTALL(
128  TARGETS mediadb
129  RUNTIME DESTINATION ${bin_DIR}
130  COMPONENT application
131)
132
133INSTALL(
134  FILES ${mediadb_TRANS}
135  DESTINATION ${qm_DIR}
136  COMPONENT application
137)
138
139INSTALL(
140  FILES mediadb.xml
141  DESTINATION ${depends_DIR}
142  COMPONENT application
143)
144
145IF(WIN32)
146  FILE(GLOB desutolib_FILES "${qt_LIBS}/*.dll")
147  INSTALL(
148    FILES ${desutolib_FILES}
149    DESTINATION ${bin_DIR}
150    COMPONENT qtlibs
151  )
152  FILE(GLOB desutolibmysql_FILES "${3rd_LIBS}/MySQL/*.dll")
153  INSTALL(
154    FILES ${desutolibmysql_FILES}
155    DESTINATION ${bin_DIR}
156    COMPONENT mysqllibs
157  )
158ENDIF(WIN32)
159
160# Install menu entry files
161IF(UNIX)
162#   IF(BUILD_PACKAGE)
163    INSTALL(
164                        FILES icons/128x128/mediadb.png
165                        DESTINATION /usr/share/pixmaps/
166                )
167                INSTALL(
168                        FILES ${CMAKE_CURRENT_BINARY_DIR}/MediaDB.desktop
169                        DESTINATION /usr/share/applications/
170                )
171#   ENDIF(BUILD_PACKAGE)
172ENDIF(UNIX)
Note: See TracBrowser for help on using the repository browser.