CMakeLists.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. ################################################################################
  2. #
  3. # :: CMake configuration
  4. #
  5. ################################################################################
  6. cmake_minimum_required(VERSION 2.8.11)
  7. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  8. option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
  9. option(USE_FILTERAUDIO "Enable the echo canceling backend" ON)
  10. if(NOT CMAKE_BUILD_TYPE)
  11. set(CMAKE_BUILD_TYPE Debug)
  12. endif()
  13. set(ENV{PKG_CONFIG_PATH}
  14. ${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
  15. # necessary to find openal-soft on mac os
  16. if(APPLE)
  17. set(ENV{PKG_CONFIG_PATH}
  18. /usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
  19. endif()
  20. execute_process(
  21. COMMAND brew --prefix qt5
  22. OUTPUT_VARIABLE QT_PREFIX_PATH
  23. OUTPUT_STRIP_TRAILING_WHITESPACE)
  24. execute_process(
  25. COMMAND xcode-select -p
  26. OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
  27. OUTPUT_STRIP_TRAILING_WHITESPACE)
  28. set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
  29. set(CMAKE_OSX_SYSROOT
  30. ${CMAKE_OSX_SYSROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk)
  31. project(qtox)
  32. # Instruct CMake to run moc automatically when needed.
  33. set(CMAKE_AUTOMOC ON)
  34. set(RCC_OPTIONS -compress 9 -threshold 0)
  35. # Use C++11.
  36. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  37. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
  38. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
  39. # Hardening flags (ASLR, warnings, etc)
  40. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -fPIC")
  41. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-overflow")
  42. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-aliasing")
  43. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
  44. if (NOT WIN32)
  45. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
  46. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstack-protector")
  47. endif()
  48. if (UNIX AND NOT APPLE)
  49. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,now")
  50. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro")
  51. endif()
  52. # Use ccache when available to speed up builds.
  53. find_program(CCACHE_FOUND ccache)
  54. if(CCACHE_FOUND)
  55. set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
  56. message(STATUS "using ccache")
  57. endif()
  58. # Search for headers in current directory.
  59. include_directories(${CMAKE_BINARY_DIR})
  60. include_directories(${CMAKE_SOURCE_DIR})
  61. include(Dependencies)
  62. ################################################################################
  63. #
  64. # :: qTox main library sources
  65. #
  66. ################################################################################
  67. qt5_wrap_ui(${PROJECT_NAME}_FORMS
  68. src/chatlog/content/filetransferwidget.ui
  69. src/loginscreen.ui
  70. src/mainwindow.ui
  71. src/widget/about/aboutfriendform.ui
  72. src/widget/form/loadhistorydialog.ui
  73. src/widget/form/profileform.ui
  74. src/widget/form/removefrienddialog.ui
  75. src/widget/form/setpassworddialog.ui
  76. src/widget/form/settings/aboutsettings.ui
  77. src/widget/form/settings/advancedsettings.ui
  78. src/widget/form/settings/avform.ui
  79. src/widget/form/settings/generalsettings.ui
  80. src/widget/form/settings/privacysettings.ui
  81. src/widget/form/settings/userinterfacesettings.ui)
  82. qt5_add_translation(${PROJECT_NAME}_QM_FILES
  83. translations/ar.ts
  84. translations/be.ts
  85. translations/bg.ts
  86. translations/cs.ts
  87. translations/da.ts
  88. translations/de.ts
  89. translations/el.ts
  90. translations/eo.ts
  91. translations/es.ts
  92. translations/et.ts
  93. translations/fi.ts
  94. translations/fr.ts
  95. translations/he.ts
  96. translations/hr.ts
  97. translations/hu.ts
  98. translations/it.ts
  99. translations/ja.ts
  100. translations/jbo.ts
  101. translations/ko.ts
  102. translations/lt.ts
  103. translations/nl.ts
  104. translations/no_nb.ts
  105. translations/pl.ts
  106. translations/pr.ts
  107. translations/pt.ts
  108. translations/ro.ts
  109. translations/ru.ts
  110. translations/sk.ts
  111. translations/sl.ts
  112. translations/sv.ts
  113. translations/sw.ts
  114. translations/ta.ts
  115. translations/tr.ts
  116. translations/ug.ts
  117. translations/uk.ts
  118. translations/zh_CN.ts
  119. translations/zh_TW.ts
  120. )
  121. qt5_add_resources(
  122. ${PROJECT_NAME}_RESOURCES
  123. res.qrc
  124. ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
  125. DEPENDS ${${PROJECT_NAME}_QM_FILES}
  126. OPTIONS ${RCC_OPTIONS}
  127. )
  128. if(NOT SMILEYS)
  129. set(SMILEYS "")
  130. endif()
  131. if(NOT "${SMILEYS}" STREQUAL "DISABLED")
  132. qt5_add_resources(
  133. ${PROJECT_NAME}_RESOURCES
  134. smileys/emojione.qrc
  135. OPTIONS ${RCC_OPTIONS})
  136. if(NOT "${SMILEYS}" STREQUAL "MIN")
  137. qt5_add_resources(
  138. ${PROJECT_NAME}_RESOURCES
  139. smileys/smileys.qrc
  140. OPTIONS ${RCC_OPTIONS})
  141. endif()
  142. endif()
  143. file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
  144. "<!DOCTYPE RCC>
  145. <RCC version=\"1.0\">
  146. <qresource prefix=\"/translations\">
  147. ")
  148. foreach(qm ${${PROJECT_NAME}_QM_FILES})
  149. get_filename_component(qm_name ${qm} NAME)
  150. file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
  151. " <file alias=\"${qm_name}\">${qm}</file>\n")
  152. endforeach(qm)
  153. file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
  154. " </qresource>
  155. </RCC>
  156. ")
  157. execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
  158. ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in
  159. ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
  160. set(${PROJECT_NAME}_SOURCES
  161. src/audio/audio.cpp
  162. src/audio/audio.h
  163. src/audio/backend/openal.cpp
  164. src/audio/backend/openal.h
  165. src/chatlog/chatlinecontent.cpp
  166. src/chatlog/chatlinecontent.h
  167. src/chatlog/chatlinecontentproxy.cpp
  168. src/chatlog/chatlinecontentproxy.h
  169. src/chatlog/chatline.cpp
  170. src/chatlog/chatline.h
  171. src/chatlog/chatlog.cpp
  172. src/chatlog/chatlog.h
  173. src/chatlog/chatmessage.cpp
  174. src/chatlog/chatmessage.h
  175. src/chatlog/content/filetransferwidget.cpp
  176. src/chatlog/content/filetransferwidget.h
  177. src/chatlog/content/image.cpp
  178. src/chatlog/content/image.h
  179. src/chatlog/content/notificationicon.cpp
  180. src/chatlog/content/notificationicon.h
  181. src/chatlog/content/spinner.cpp
  182. src/chatlog/content/spinner.h
  183. src/chatlog/content/text.cpp
  184. src/chatlog/content/text.h
  185. src/chatlog/content/timestamp.cpp
  186. src/chatlog/content/timestamp.h
  187. src/chatlog/customtextdocument.cpp
  188. src/chatlog/customtextdocument.h
  189. src/chatlog/documentcache.cpp
  190. src/chatlog/documentcache.h
  191. src/chatlog/pixmapcache.cpp
  192. src/chatlog/pixmapcache.h
  193. src/chatlog/textformatter.cpp
  194. src/chatlog/textformatter.h
  195. src/core/coreav.cpp
  196. src/core/coreav.h
  197. src/core/core.cpp
  198. src/core/corefile.cpp
  199. src/core/corefile.h
  200. src/core/core.h
  201. src/core/corestructs.cpp
  202. src/core/corestructs.h
  203. src/core/indexedlist.h
  204. src/core/recursivesignalblocker.cpp
  205. src/core/recursivesignalblocker.h
  206. src/core/toxcall.cpp
  207. src/core/toxcall.h
  208. src/core/toxencrypt.cpp
  209. src/core/toxencrypt.h
  210. src/core/toxid.cpp
  211. src/core/toxid.h
  212. src/core/toxpk.cpp
  213. src/core/toxpk.h
  214. src/core/toxstring.cpp
  215. src/core/toxstring.h
  216. src/friendlist.cpp
  217. src/friendlist.h
  218. src/model/groupinvite.cpp
  219. src/model/groupinvite.h
  220. src/grouplist.cpp
  221. src/grouplist.h
  222. src/ipc.cpp
  223. src/ipc.h
  224. src/model/about/aboutfriend.cpp
  225. src/model/about/aboutfriend.h
  226. src/model/about/iaboutfriend.h
  227. src/model/contact.cpp
  228. src/model/contact.h
  229. src/model/friend.cpp
  230. src/model/friend.h
  231. src/model/group.cpp
  232. src/model/group.h
  233. src/net/autoupdate.cpp
  234. src/net/autoupdate.h
  235. src/net/avatarbroadcaster.cpp
  236. src/net/avatarbroadcaster.h
  237. src/net/toxme.cpp
  238. src/net/toxme.h
  239. src/net/toxuri.cpp
  240. src/net/toxuri.h
  241. src/nexus.cpp
  242. src/nexus.h
  243. src/persistence/db/rawdatabase.cpp
  244. src/persistence/db/rawdatabase.h
  245. src/persistence/history.cpp
  246. src/persistence/history.h
  247. src/persistence/offlinemsgengine.cpp
  248. src/persistence/offlinemsgengine.h
  249. src/persistence/profile.cpp
  250. src/persistence/profile.h
  251. src/persistence/profilelocker.cpp
  252. src/persistence/profilelocker.h
  253. src/persistence/serialize.cpp
  254. src/persistence/serialize.h
  255. src/persistence/settings.cpp
  256. src/persistence/settings.h
  257. src/persistence/settingsserializer.cpp
  258. src/persistence/settingsserializer.h
  259. src/persistence/smileypack.cpp
  260. src/persistence/smileypack.h
  261. src/persistence/toxsave.cpp
  262. src/persistence/toxsave.h
  263. src/video/cameradevice.cpp
  264. src/video/cameradevice.h
  265. src/video/camerasource.cpp
  266. src/video/camerasource.h
  267. src/video/corevideosource.cpp
  268. src/video/corevideosource.h
  269. src/video/genericnetcamview.cpp
  270. src/video/genericnetcamview.h
  271. src/video/groupnetcamview.cpp
  272. src/video/groupnetcamview.h
  273. src/video/netcamview.cpp
  274. src/video/netcamview.h
  275. src/video/videoframe.cpp
  276. src/video/videoframe.h
  277. src/video/videomode.cpp
  278. src/video/videomode.h
  279. src/video/videosource.cpp
  280. src/video/videosource.h
  281. src/video/videosurface.cpp
  282. src/video/videosurface.h
  283. src/widget/about/aboutfriendform.cpp
  284. src/widget/about/aboutfriendform.h
  285. src/widget/categorywidget.cpp
  286. src/widget/categorywidget.h
  287. src/widget/circlewidget.cpp
  288. src/widget/circlewidget.h
  289. src/widget/contentdialog.cpp
  290. src/widget/contentdialog.h
  291. src/widget/contentlayout.cpp
  292. src/widget/contentlayout.h
  293. src/widget/emoticonswidget.cpp
  294. src/widget/emoticonswidget.h
  295. src/widget/flowlayout.cpp
  296. src/widget/flowlayout.h
  297. src/widget/form/addfriendform.cpp
  298. src/widget/form/addfriendform.h
  299. src/widget/form/chatform.cpp
  300. src/widget/form/chatform.h
  301. src/widget/form/filesform.cpp
  302. src/widget/form/filesform.h
  303. src/widget/form/genericchatform.cpp
  304. src/widget/form/genericchatform.h
  305. src/widget/form/groupchatform.cpp
  306. src/widget/form/groupchatform.h
  307. src/widget/form/groupinviteform.cpp
  308. src/widget/form/groupinviteform.h
  309. src/widget/form/groupinvitewidget.cpp
  310. src/widget/form/groupinvitewidget.h
  311. src/widget/form/loadhistorydialog.cpp
  312. src/widget/form/loadhistorydialog.h
  313. src/widget/form/profileform.cpp
  314. src/widget/form/profileform.h
  315. src/widget/form/setpassworddialog.cpp
  316. src/widget/form/setpassworddialog.h
  317. src/widget/form/settings/aboutform.cpp
  318. src/widget/form/settings/aboutform.h
  319. src/widget/form/settings/advancedform.cpp
  320. src/widget/form/settings/advancedform.h
  321. src/widget/form/settings/avform.cpp
  322. src/widget/form/settings/avform.h
  323. src/widget/form/settings/generalform.cpp
  324. src/widget/form/settings/generalform.h
  325. src/widget/form/settings/genericsettings.cpp
  326. src/widget/form/settings/genericsettings.h
  327. src/widget/form/settings/privacyform.cpp
  328. src/widget/form/settings/privacyform.h
  329. src/widget/form/settings/userinterfaceform.h
  330. src/widget/form/settings/userinterfaceform.cpp
  331. src/widget/form/settings/verticalonlyscroller.cpp
  332. src/widget/form/settings/verticalonlyscroller.h
  333. src/widget/form/settingswidget.cpp
  334. src/widget/form/settingswidget.h
  335. src/widget/form/tabcompleter.cpp
  336. src/widget/form/tabcompleter.h
  337. src/widget/friendlistlayout.cpp
  338. src/widget/friendlistlayout.h
  339. src/widget/friendlistwidget.cpp
  340. src/widget/friendlistwidget.h
  341. src/widget/friendwidget.cpp
  342. src/widget/friendwidget.h
  343. src/widget/genericchatitemlayout.cpp
  344. src/widget/genericchatitemlayout.h
  345. src/widget/genericchatitemwidget.cpp
  346. src/widget/genericchatitemwidget.h
  347. src/widget/genericchatroomwidget.cpp
  348. src/widget/genericchatroomwidget.h
  349. src/widget/groupwidget.cpp
  350. src/widget/groupwidget.h
  351. src/widget/gui.cpp
  352. src/widget/gui.h
  353. src/widget/loginscreen.cpp
  354. src/widget/loginscreen.h
  355. src/widget/maskablepixmapwidget.cpp
  356. src/widget/maskablepixmapwidget.h
  357. src/widget/notificationedgewidget.cpp
  358. src/widget/notificationedgewidget.h
  359. src/widget/notificationscrollarea.cpp
  360. src/widget/notificationscrollarea.h
  361. src/widget/passwordedit.cpp
  362. src/widget/passwordedit.h
  363. src/widget/qrwidget.cpp
  364. src/widget/qrwidget.h
  365. src/widget/splitterrestorer.cpp
  366. src/widget/splitterrestorer.h
  367. src/widget/style.cpp
  368. src/widget/style.h
  369. src/widget/systemtrayicon.cpp
  370. src/widget/systemtrayicon.h
  371. src/widget/systemtrayicon_private.h
  372. src/widget/tool/activatedialog.cpp
  373. src/widget/tool/activatedialog.h
  374. src/widget/tool/adjustingscrollarea.cpp
  375. src/widget/tool/adjustingscrollarea.h
  376. src/widget/tool/callconfirmwidget.cpp
  377. src/widget/tool/callconfirmwidget.h
  378. src/widget/tool/chattextedit.cpp
  379. src/widget/tool/chattextedit.h
  380. src/widget/tool/croppinglabel.cpp
  381. src/widget/tool/croppinglabel.h
  382. src/widget/tool/flyoutoverlaywidget.cpp
  383. src/widget/tool/flyoutoverlaywidget.h
  384. src/widget/tool/friendrequestdialog.cpp
  385. src/widget/tool/friendrequestdialog.h
  386. src/widget/tool/movablewidget.cpp
  387. src/widget/tool/movablewidget.h
  388. src/widget/tool/profileimporter.cpp
  389. src/widget/tool/profileimporter.h
  390. src/widget/tool/removefrienddialog.cpp
  391. src/widget/tool/removefrienddialog.h
  392. src/widget/tool/screengrabberchooserrectitem.cpp
  393. src/widget/tool/screengrabberchooserrectitem.h
  394. src/widget/tool/screengrabberoverlayitem.cpp
  395. src/widget/tool/screengrabberoverlayitem.h
  396. src/widget/tool/screenshotgrabber.cpp
  397. src/widget/tool/screenshotgrabber.h
  398. src/widget/tool/toolboxgraphicsitem.cpp
  399. src/widget/tool/toolboxgraphicsitem.h
  400. src/widget/translator.cpp
  401. src/widget/translator.h
  402. src/widget/widget.cpp
  403. src/widget/widget.h
  404. )
  405. if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  406. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  407. src/platform/camera/directshow.cpp
  408. src/platform/camera/directshow.h
  409. )
  410. set(${PROJECT_NAME}_RESOURCES ${${PROJECT_NAME}_RESOURCES}
  411. windows/qtox.rc
  412. )
  413. elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  414. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  415. src/platform/camera/v4l2.cpp
  416. src/platform/camera/v4l2.h
  417. )
  418. elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  419. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  420. src/platform/install_osx.cpp
  421. src/platform/install_osx.h
  422. )
  423. endif()
  424. if (UNIX)
  425. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  426. src/platform/posixsignalnotifier.cpp
  427. src/platform/posixsignalnotifier.h
  428. )
  429. endif()
  430. if (PLATFORM_EXTENSIONS)
  431. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  432. src/platform/autorun.h
  433. src/platform/capslock.h
  434. src/platform/timer.h
  435. src/platform/autorun_osx.cpp
  436. src/platform/autorun_win.cpp
  437. src/platform/autorun_xdg.cpp
  438. src/platform/capslock_osx.cpp
  439. src/platform/capslock_win.cpp
  440. src/platform/capslock_x11.cpp
  441. src/platform/timer_osx.cpp
  442. src/platform/timer_win.cpp
  443. src/platform/timer_x11.cpp
  444. src/platform/x11_display.cpp
  445. )
  446. endif()
  447. add_definitions(-DQT_MESSAGELOGCONTEXT=1)
  448. if (NOT DEFINED ENABLE_STATUSNOTIFIER AND UNIX AND NOT APPLE)
  449. set(ENABLE_STATUSNOTIFIER True)
  450. endif()
  451. if(${ENABLE_STATUSNOTIFIER})
  452. search_dependency(GDK_PIXBUF PACKAGE gdk-pixbuf-2.0 OPTIONAL)
  453. search_dependency(GLIB PACKAGE glib-2.0 OPTIONAL)
  454. search_dependency(GTK PACKAGE gtk+-2.0 OPTIONAL)
  455. if(GDK_PIXBUF_FOUND AND GLIB_FOUND AND GTK_FOUND)
  456. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  457. src/platform/statusnotifier/closures.c
  458. src/platform/statusnotifier/closures.h
  459. src/platform/statusnotifier/enums.c
  460. src/platform/statusnotifier/enums.h
  461. src/platform/statusnotifier/interfaces.h
  462. src/platform/statusnotifier/statusnotifier.c
  463. src/platform/statusnotifier/statusnotifier.h)
  464. add_definitions(-DENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND=1)
  465. endif()
  466. endif()
  467. if(AVFOUNDATION_FOUND)
  468. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  469. src/platform/camera/avfoundation.mm
  470. src/platform/camera/avfoundation.h)
  471. endif()
  472. if (NOT DEFINED ENABLE_APPINDICATOR AND UNIX AND NOT APPLE)
  473. set(ENABLE_APPINDICATOR False)
  474. endif()
  475. if(${ENABLE_APPINDICATOR})
  476. search_dependency(APPINDICATOR PACKAGE appindicator-0.1)
  477. search_dependency(GDK_PIXBUF PACKAGE gdk-pixbuf-2.0)
  478. search_dependency(GLIB PACKAGE glib-2.0)
  479. search_dependency(GTK PACKAGE gtk+-2.0)
  480. if(APPINDICATOR_FOUND)
  481. add_definitions(-DENABLE_SYSTRAY_UNITY_BACKEND=1)
  482. endif()
  483. endif()
  484. if (NOT DEFINED ENABLE_GTK_SYSTRAY AND UNIX AND NOT APPLE)
  485. set(ENABLE_GTK_SYSTRAY True)
  486. endif()
  487. if(${ENABLE_GTK_SYSTRAY})
  488. if(NOT GTK_FOUND)
  489. search_dependency(GTK PACKAGE gtk+-2.0 OPTIONAL)
  490. endif()
  491. if(GTK_FOUND)
  492. add_definitions(-DENABLE_SYSTRAY_GTK_BACKEND=1)
  493. endif()
  494. endif()
  495. if(${USE_FILTERAUDIO})
  496. search_dependency(FILTERAUDIO LIBRARY filteraudio HEADER filter_audio.h OPTIONAL)
  497. if(${FILTERAUDIO_FOUND})
  498. set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
  499. src/audio/backend/openal2.cpp
  500. src/audio/backend/openal2.h)
  501. add_definitions(-DUSE_FILTERAUDIO=1)
  502. message(STATUS "using filteraudio")
  503. else()
  504. message(STATUS "not using filteraudio, libfilteraudio not found")
  505. endif()
  506. endif()
  507. # the compiler flags for compiling C sources
  508. MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
  509. # the compiler flags for compiling C++ sources
  510. MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
  511. add_library(${PROJECT_NAME}_static
  512. STATIC
  513. ${${PROJECT_NAME}_FORMS}
  514. ${${PROJECT_NAME}_SOURCES}
  515. ${${PROJECT_NAME}_QM_FILES})
  516. target_link_libraries(${PROJECT_NAME}_static
  517. ${ALL_LIBRARIES})
  518. add_executable(${PROJECT_NAME}
  519. WIN32
  520. MACOSX_BUNDLE
  521. ${${PROJECT_NAME}_RESOURCES}
  522. src/main.cpp)
  523. target_link_libraries(${PROJECT_NAME}
  524. ${PROJECT_NAME}_static
  525. ${ALL_LIBRARIES})
  526. include(Testing)
  527. include(Installation)