53 set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") |
53 set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") |
54 |
54 |
55 if (CMAKE_SYSTEM_NAME MATCHES Linux) |
55 if (CMAKE_SYSTEM_NAME MATCHES Linux) |
56 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") |
56 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") |
57 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common") |
57 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common") |
58 add_definitions (-D_BSD_SOURCE) |
58 add_definitions (-D_BSD_SOURCE -DQT_NO_EXCEPTIONS) |
59 endif (CMAKE_SYSTEM_NAME MATCHES Linux) |
59 endif (CMAKE_SYSTEM_NAME MATCHES Linux) |
60 |
60 |
61 # gcc under Windows |
61 # gcc under Windows |
62 if (MINGW) |
62 if (MINGW) |
63 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") |
63 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") |
113 if (GCC_IS_NEWER_THAN_4_1) |
113 if (GCC_IS_NEWER_THAN_4_1) |
114 exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info) |
114 exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info) |
115 string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") |
115 string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") |
116 endif (GCC_IS_NEWER_THAN_4_1) |
116 endif (GCC_IS_NEWER_THAN_4_1) |
117 |
117 |
118 if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) |
118 if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32) |
119 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
119 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
120 set (KDE4_C_FLAGS "-fvisibility=hidden") |
120 set (KDE4_C_FLAGS "-fvisibility=hidden") |
121 # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default"))) |
121 # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default"))) |
122 # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break |
122 # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break |
123 set(_source "#include <QtCore/QtGlobal>\n int main()\n {\n #ifdef QT_VISIBILITY_AVAILABLE \n return 0;\n #else \n return 1; \n #endif \n }\n") |
123 set(_source "#include <QtCore/QtGlobal>\n int main()\n {\n #ifdef QT_VISIBILITY_AVAILABLE \n return 0;\n #else \n return 1; \n #endif \n }\n") |
135 endif(_run_result) |
135 endif(_run_result) |
136 |
136 |
137 if (GCC_IS_NEWER_THAN_4_2) |
137 if (GCC_IS_NEWER_THAN_4_2) |
138 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") |
138 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") |
139 endif (GCC_IS_NEWER_THAN_4_2) |
139 endif (GCC_IS_NEWER_THAN_4_2) |
140 else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) |
140 else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32) |
141 set (__KDE_HAVE_GCC_VISIBILITY 0) |
141 set (__KDE_HAVE_GCC_VISIBILITY 0) |
142 endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) |
142 endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32) |
143 |
143 |
144 endif (CMAKE_COMPILER_IS_GNUCXX) |
144 endif (CMAKE_COMPILER_IS_GNUCXX) |
145 |
145 |
146 set(CMAKE_INCLUDE_CURRENT_DIR ON) |
146 set(CMAKE_INCLUDE_CURRENT_DIR ON) |
147 set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) |
147 set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) |
148 set(CMAKE_COLOR_MAKEFILE ON) |
148 set(CMAKE_COLOR_MAKEFILE ON) |
149 |
149 |
150 set(PHONON_LIB_MAJOR_VERSION "4") |
150 set(PHONON_LIB_MAJOR_VERSION "4") |
151 set(PHONON_LIB_MINOR_VERSION "3") |
151 set(PHONON_LIB_MINOR_VERSION "3") |
152 set(PHONON_LIB_PATCH_VERSION "1") |
152 set(PHONON_LIB_PATCH_VERSION "50") |
153 set(PHONON_LIB_VERSION "${PHONON_LIB_MAJOR_VERSION}.3.1") |
153 set(PHONON_LIB_VERSION "${PHONON_LIB_MAJOR_VERSION}.4.0") |
154 set(PHONON_LIB_SOVERSION ${PHONON_LIB_MAJOR_VERSION}) |
154 set(PHONON_LIB_SOVERSION ${PHONON_LIB_MAJOR_VERSION}) |
155 |
155 |
156 add_definitions(${QT_DEFINITIONS}) |
156 add_definitions(${QT_DEFINITIONS}) |
157 remove_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT) |
157 remove_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT) |
158 if(MSVC) |
158 if(MSVC) |
175 endif (KDESupport_SOURCE_DIR) |
175 endif (KDESupport_SOURCE_DIR) |
176 endmacro(_SET_FANCY) |
176 endmacro(_SET_FANCY) |
177 |
177 |
178 set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) |
178 set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) |
179 |
179 |
180 _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries") |
180 if (WIN32) |
181 _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/") |
181 _set_fancy(EXEC_INSTALL_PREFIX "." "Base directory for executables and libraries") |
|
182 else(WIN32) |
|
183 _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries") |
|
184 endif(WIN32) |
|
185 _set_fancy(SHARE_INSTALL_PREFIX "${EXEC_INSTALL_PREFIX}/share" "Base directory for files which go to share/") |
|
186 _set_fancy(INCLUDE_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/include" "The subdirectory to the header prefix") |
182 _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") |
187 _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") |
183 _set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})") |
188 _set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})") |
184 _set_fancy(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "The subdirectory to the header prefix") |
|
185 _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)") |
189 _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)") |
186 _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)") |
190 _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)") |
187 _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files") |
191 _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files") |
188 _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The dbus interfaces install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") |
192 _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The dbus interfaces install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") |
189 _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The dbus services install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/services)") |
193 _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The dbus services install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/services)") |
194 |
198 |
195 # on the Mac support an extra install directory for application bundles |
199 # on the Mac support an extra install directory for application bundles |
196 if(APPLE) |
200 if(APPLE) |
197 set(INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS} |
201 set(INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS} |
198 BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) |
202 BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) |
|
203 set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined dynamic_lookup") |
|
204 set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined dynamic_lookup") |
199 endif(APPLE) |
205 endif(APPLE) |
200 |
206 |
201 if (CMAKE_SYSTEM_NAME MATCHES Linux) |
207 if (CMAKE_SYSTEM_NAME MATCHES Linux) |
202 if (CMAKE_COMPILER_IS_GNUCXX) |
208 if (CMAKE_COMPILER_IS_GNUCXX) |
203 set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") |
209 set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") |
247 if(APPLE) |
253 if(APPLE) |
248 set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) |
254 set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) |
249 endif(APPLE) |
255 endif(APPLE) |
250 |
256 |
251 |
257 |
252 add_subdirectory(cmake) |
|
253 add_subdirectory(phonon) |
258 add_subdirectory(phonon) |
254 add_subdirectory(includes) |
259 add_subdirectory(includes) |
255 if (Q_WS_MAC AND BUILD_PHONON_QT7) |
260 if (Q_WS_MAC AND BUILD_PHONON_QT7) |
256 add_subdirectory(qt7) |
261 add_subdirectory(qt7) |
257 endif (Q_WS_MAC AND BUILD_PHONON_QT7) |
262 endif (Q_WS_MAC AND BUILD_PHONON_QT7) |