Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

904 lines
25KB

  1. cmake_minimum_required(VERSION 3.15)
  2. project(carla)
  3. set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
  4. set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
  5. set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
  6. set(CMAKE_C_STANDARD 11)
  7. set(CMAKE_CXX_STANDARD 11)
  8. set(CMAKE_C_VISIBILITY_PRESET hidden)
  9. set(CMAKE_CXX_VISIBILITY_PRESET hidden)
  10. set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
  11. set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
  12. #######################################################################################################################
  13. # fix compat with cmake < 3.26
  14. if(CMAKE_VERSION VERSION_LESS 3.26)
  15. if(MSVC)
  16. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
  17. else()
  18. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
  19. endif()
  20. mark_as_advanced(CMAKE_C_COMPILER_FRONTEND_VARIANT)
  21. endif()
  22. #######################################################################################################################
  23. # build options
  24. set(CARLA_USE_JACK TRUE CACHE BOOL "Enable JACK")
  25. set(CARLA_USE_OSC TRUE CACHE BOOL "Enable OSC")
  26. #######################################################################################################################
  27. # required dependencies
  28. find_package(Threads REQUIRED)
  29. if(NOT (APPLE OR HAIKU OR WIN32))
  30. set(CARLA_LIBDL dl)
  31. set(CARLA_LIBM m)
  32. set(CARLA_LIBRT rt)
  33. endif()
  34. #######################################################################################################################
  35. # optional dependencies
  36. find_package(PkgConfig)
  37. # homebrew does not support universal binaries, disable external deps if it is in use
  38. if(APPLE)
  39. find_program(HOMEBREW brew)
  40. if(HOMEBREW)
  41. set(PKGCONFIG_FOUND FALSE)
  42. mark_as_advanced(PKGCONFIG_FOUND)
  43. endif()
  44. endif()
  45. if(PKGCONFIG_FOUND)
  46. pkg_check_modules(FLUIDSYNTH IMPORTED_TARGET fluidsynth)
  47. pkg_check_modules(SNDFILE IMPORTED_TARGET sndfile)
  48. else()
  49. set(FLUIDSYNTH_FOUND FALSE)
  50. set(LIBLO_FOUND FALSE)
  51. set(SNDFILE_FOUND FALSE)
  52. endif()
  53. if(PKGCONFIG_FOUND AND CARLA_USE_OSC)
  54. pkg_check_modules(LIBLO IMPORTED_TARGET liblo)
  55. else()
  56. set(LIBLO_FOUND FALSE)
  57. endif()
  58. if(PKGCONFIG_FOUND AND NOT WIN32)
  59. pkg_check_modules(LIBMAGIC IMPORTED_TARGET libmagic)
  60. else()
  61. set(LIBMAGIC_FOUND FALSE)
  62. endif()
  63. if(PKGCONFIG_FOUND AND NOT (APPLE OR WIN32))
  64. pkg_check_modules(X11 IMPORTED_TARGET x11)
  65. else()
  66. set(X11_FOUND FALSE)
  67. endif()
  68. add_library(carla-none INTERFACE)
  69. if(NOT FLUIDSYNTH_FOUND)
  70. add_library(PkgConfig::FLUIDSYNTH ALIAS carla-none)
  71. endif()
  72. if(NOT LIBLO_FOUND)
  73. add_library(PkgConfig::LIBLO ALIAS carla-none)
  74. endif()
  75. if(NOT LIBMAGIC_FOUND)
  76. add_library(PkgConfig::LIBMAGIC ALIAS carla-none)
  77. endif()
  78. if(NOT SNDFILE_FOUND)
  79. add_library(PkgConfig::SNDFILE ALIAS carla-none)
  80. endif()
  81. if(NOT X11_FOUND)
  82. add_library(PkgConfig::X11 ALIAS carla-none)
  83. endif()
  84. #######################################################################################################################
  85. # utilities
  86. function(set_common_target_properties TARGET)
  87. target_compile_definitions(${TARGET}
  88. PRIVATE
  89. BUILDING_CARLA
  90. HAVE_YSFX
  91. $<$<BOOL:${CARLA_USE_JACK}>:HAVE_JACK>
  92. $<$<BOOL:${FLUIDSYNTH_FOUND}>:HAVE_FLUIDSYNTH>
  93. $<$<BOOL:${LIBLO_FOUND}>:HAVE_LIBLO>
  94. $<$<BOOL:${LIBMAGIC_FOUND}>:HAVE_LIBMAGIC>
  95. $<$<BOOL:${SNDFILE_FOUND}>:HAVE_SNDFILE>
  96. $<$<BOOL:${X11_FOUND}>:HAVE_X11>
  97. )
  98. target_compile_options(${TARGET}
  99. PRIVATE
  100. $<$<BOOL:${MSVC}>:/wd4244>
  101. $<$<BOOL:${MSVC}>:/wd4267>
  102. $<$<BOOL:${MSVC}>:/wd4273>
  103. )
  104. target_link_options(${TARGET}
  105. PRIVATE
  106. $<$<C_COMPILER_ID:GNU>:-Wl,--no-undefined>
  107. )
  108. set_property(TARGET ${TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)
  109. if(APPLE)
  110. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES arm64)
  111. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES x86_64)
  112. endif()
  113. endfunction()
  114. #######################################################################################################################
  115. # setup pthreads for msvc
  116. if(MSVC)
  117. include(FetchContent)
  118. FetchContent_Declare(pthreads4w
  119. GIT_REPOSITORY https://git.code.sf.net/p/pthreads4w/code
  120. GIT_TAG f12b445b336ee0117b43fca1d4b9f22c9af82c36
  121. )
  122. FetchContent_MakeAvailable(pthreads4w)
  123. add_library(pthreads4w STATIC)
  124. add_library(carla::pthreads4w ALIAS pthreads4w)
  125. target_sources(pthreads4w PRIVATE ${pthreads4w_SOURCE_DIR}/pthread.c)
  126. target_compile_definitions(pthreads4w
  127. PRIVATE
  128. HAVE_CONFIG_H
  129. HAVE_STDINT_H=1
  130. _POSIX_C_SOURCE=200112L
  131. PUBLIC
  132. INCLUDE_NP
  133. PTW32_DLLPORT
  134. __PTW32_STATIC_LIB
  135. )
  136. target_include_directories(pthreads4w
  137. PUBLIC
  138. ${pthreads4w_SOURCE_DIR}
  139. )
  140. set(CARLA_PTHREADS carla::pthreads4w)
  141. else()
  142. set(CARLA_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
  143. endif()
  144. #######################################################################################################################
  145. # audio_decoder
  146. add_library(carla-audio-decoder STATIC)
  147. add_library(carla::audio-decoder ALIAS carla-audio-decoder)
  148. set_common_target_properties(carla-audio-decoder)
  149. target_include_directories(carla-audio-decoder
  150. PRIVATE
  151. ../source/includes
  152. ../source/modules
  153. ../source/utils
  154. )
  155. target_link_libraries(carla-audio-decoder
  156. PRIVATE
  157. PkgConfig::SNDFILE
  158. )
  159. target_sources(carla-audio-decoder
  160. PRIVATE
  161. ../source/modules/audio_decoder/ad_dr_mp3.c
  162. ../source/modules/audio_decoder/ad_ffmpeg.c
  163. ../source/modules/audio_decoder/ad_minimp3.c
  164. ../source/modules/audio_decoder/ad_plugin.c
  165. ../source/modules/audio_decoder/ad_soundfile.c
  166. )
  167. #######################################################################################################################
  168. # jackbridge
  169. add_library(carla-jackbridge STATIC)
  170. add_library(carla::jackbridge ALIAS carla-jackbridge)
  171. set_common_target_properties(carla-jackbridge)
  172. target_include_directories(carla-jackbridge
  173. PRIVATE
  174. ../source/includes
  175. ../source/utils
  176. )
  177. target_link_libraries(carla-jackbridge
  178. PRIVATE
  179. ${CARLA_LIBDL}
  180. ${CARLA_LIBRT}
  181. )
  182. target_sources(carla-jackbridge
  183. PRIVATE
  184. ../source/jackbridge/JackBridge1.cpp
  185. ../source/jackbridge/JackBridge2.cpp
  186. )
  187. #######################################################################################################################
  188. # lilv
  189. # serd
  190. add_library(carla-lilv_serd STATIC)
  191. set_common_target_properties(carla-lilv_serd)
  192. target_compile_options(carla-lilv_serd
  193. PRIVATE
  194. $<$<BOOL:${MSVC}>:/wd4005>
  195. $<$<BOOL:${MSVC}>:/wd4090>
  196. $<$<BOOL:${MSVC}>:/wd4133>
  197. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  198. $<$<C_COMPILER_ID:GNU>:-Wno-implicit-fallthrough>
  199. )
  200. target_include_directories(carla-lilv_serd
  201. PRIVATE
  202. ../source/includes
  203. ../source/modules/lilv/config
  204. ../source/modules/lilv/serd-0.24.0
  205. )
  206. target_sources(carla-lilv_serd
  207. PRIVATE
  208. ../source/modules/lilv/serd.c
  209. )
  210. # sord
  211. add_library(carla-lilv_sord STATIC)
  212. set_common_target_properties(carla-lilv_sord)
  213. target_compile_options(carla-lilv_sord
  214. PRIVATE
  215. $<$<BOOL:${MSVC}>:/wd4005>
  216. $<$<BOOL:${MSVC}>:/wd4090>
  217. $<$<BOOL:${MSVC}>:/wd4133>
  218. $<$<C_COMPILER_ID:GNU>:-Wno-maybe-uninitialized>
  219. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  220. # workaround compiler bug, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
  221. $<$<C_COMPILER_ID:GNU>:-fno-strict-aliasing>
  222. )
  223. target_include_directories(carla-lilv_sord
  224. PRIVATE
  225. ../source/includes
  226. ../source/modules/lilv/config
  227. ../source/modules/lilv/sord-0.16.0
  228. ../source/modules/lilv/sord-0.16.0/src
  229. )
  230. target_link_libraries(carla-lilv_sord
  231. PRIVATE
  232. carla-lilv_serd
  233. )
  234. target_sources(carla-lilv_sord
  235. PRIVATE
  236. ../source/modules/lilv/sord.c
  237. )
  238. # sratom
  239. add_library(carla-lilv_sratom STATIC)
  240. set_common_target_properties(carla-lilv_sratom)
  241. target_compile_options(carla-lilv_sratom
  242. PRIVATE
  243. $<$<BOOL:${MSVC}>:/wd4005>
  244. $<$<BOOL:${MSVC}>:/wd4090>
  245. $<$<BOOL:${MSVC}>:/wd4133>
  246. )
  247. target_include_directories(carla-lilv_sratom
  248. PRIVATE
  249. ../source/includes
  250. ../source/modules/lilv/config
  251. ../source/modules/lilv/sratom-0.6.0
  252. )
  253. target_link_libraries(carla-lilv_sratom
  254. PRIVATE
  255. carla-lilv_serd
  256. )
  257. target_sources(carla-lilv_sratom
  258. PRIVATE
  259. ../source/modules/lilv/sratom.c
  260. )
  261. # lilv
  262. add_library(carla-lilv_lilv STATIC)
  263. set_common_target_properties(carla-lilv_lilv)
  264. target_compile_options(carla-lilv_lilv
  265. PRIVATE
  266. $<$<BOOL:${MSVC}>:/wd4005>
  267. $<$<BOOL:${MSVC}>:/wd4090>
  268. $<$<BOOL:${MSVC}>:/wd4133>
  269. $<$<C_COMPILER_ID:AppleClang>:-Wno-incompatible-pointer-types-discards-qualifiers>
  270. $<$<C_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
  271. $<$<C_COMPILER_ID:GNU>:-Wno-discarded-qualifiers>
  272. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  273. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  274. )
  275. target_include_directories(carla-lilv_lilv
  276. PRIVATE
  277. ../source/includes
  278. ../source/modules/lilv/config
  279. ../source/modules/lilv/lilv-0.24.0
  280. ../source/modules/lilv/lilv-0.24.0/src
  281. )
  282. target_link_libraries(carla-lilv_lilv
  283. PRIVATE
  284. carla-lilv_serd
  285. carla-lilv_sord
  286. carla-lilv_sratom
  287. )
  288. target_sources(carla-lilv_lilv
  289. PRIVATE
  290. ../source/modules/lilv/lilv.c
  291. )
  292. # combined target
  293. add_library(carla-lilv INTERFACE)
  294. add_library(carla::lilv ALIAS carla-lilv)
  295. target_link_libraries(carla-lilv
  296. INTERFACE
  297. carla-lilv_serd
  298. carla-lilv_sord
  299. carla-lilv_sratom
  300. carla-lilv_lilv
  301. ${CARLA_LIBDL}
  302. ${CARLA_LIBM}
  303. ${CARLA_LIBRT}
  304. )
  305. #######################################################################################################################
  306. # native-plugins
  307. add_library(carla-native-plugins STATIC)
  308. add_library(carla::native-plugins ALIAS carla-native-plugins)
  309. set_common_target_properties(carla-native-plugins)
  310. target_include_directories(carla-native-plugins
  311. PRIVATE
  312. ../source/includes
  313. ../source/modules
  314. ../source/utils
  315. )
  316. target_sources(carla-native-plugins
  317. PRIVATE
  318. ../source/native-plugins/_all.c
  319. ../source/native-plugins/_data.cpp
  320. ../source/native-plugins/audio-gain.c
  321. ../source/native-plugins/bypass.c
  322. ../source/native-plugins/cv-to-audio.c
  323. ../source/native-plugins/lfo.c
  324. ../source/native-plugins/midi-channel-filter.c
  325. ../source/native-plugins/midi-channel-ab.c
  326. ../source/native-plugins/midi-channelize.c
  327. ../source/native-plugins/midi-gain.c
  328. ../source/native-plugins/midi-join.c
  329. ../source/native-plugins/midi-split.c
  330. ../source/native-plugins/midi-to-cv.c
  331. ../source/native-plugins/midi-through.c
  332. ../source/native-plugins/midi-transpose.c
  333. ../source/native-plugins/audio-file.cpp
  334. ../source/native-plugins/midi-file.cpp
  335. # these rely on PyQt, skip them
  336. # ../source/native-plugins/bigmeter.cpp
  337. # ../source/native-plugins/midi-pattern.cpp
  338. # ../source/native-plugins/notes.cpp
  339. # ../source/native-plugins/xycontroller.cpp
  340. )
  341. #######################################################################################################################
  342. # rtmempool
  343. add_library(carla-rtmempool STATIC)
  344. add_library(carla::rtmempool ALIAS carla-rtmempool)
  345. set_common_target_properties(carla-rtmempool)
  346. target_include_directories(carla-rtmempool
  347. PRIVATE
  348. ../source/includes
  349. ../source/utils
  350. )
  351. target_link_libraries(carla-rtmempool
  352. PRIVATE
  353. ${CARLA_LIBDL}
  354. ${CARLA_LIBRT}
  355. )
  356. target_sources(carla-rtmempool
  357. PRIVATE
  358. ../source/modules/rtmempool/rtmempool.c
  359. )
  360. #######################################################################################################################
  361. # sfzero
  362. add_library(carla-sfzero STATIC)
  363. add_library(carla::sfzero ALIAS carla-sfzero)
  364. set_common_target_properties(carla-sfzero)
  365. target_include_directories(carla-sfzero
  366. PRIVATE
  367. ../source/includes
  368. ../source/modules
  369. ../source/utils
  370. )
  371. target_link_libraries(carla-sfzero
  372. PRIVATE
  373. carla-audio-decoder
  374. )
  375. target_sources(carla-sfzero
  376. PRIVATE
  377. ../source/modules/sfzero/SFZero.cpp
  378. )
  379. #######################################################################################################################
  380. # water
  381. add_library(carla-water STATIC)
  382. add_library(carla::water ALIAS carla-water)
  383. set_common_target_properties(carla-water)
  384. target_compile_options(carla-water
  385. PRIVATE
  386. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  387. )
  388. target_include_directories(carla-water
  389. PRIVATE
  390. ../source/includes
  391. ../source/utils
  392. )
  393. target_link_libraries(carla-water
  394. PRIVATE
  395. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  396. $<$<BOOL:${WIN32}>:comdlg32>
  397. $<$<BOOL:${WIN32}>:ole32>
  398. $<$<BOOL:${WIN32}>:winmm>
  399. ${CARLA_LIBDL}
  400. ${CARLA_LIBRT}
  401. )
  402. target_sources(carla-water
  403. PRIVATE
  404. ../source/modules/water/water.cpp
  405. )
  406. #######################################################################################################################
  407. # water-files
  408. add_library(carla-water-files STATIC)
  409. add_library(carla::water-files ALIAS carla-water-files)
  410. set_common_target_properties(carla-water-files)
  411. target_compile_options(carla-water-files
  412. PRIVATE
  413. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  414. )
  415. target_include_directories(carla-water-files
  416. PRIVATE
  417. ../source/includes
  418. ../source/utils
  419. )
  420. target_link_libraries(carla-water-files
  421. PRIVATE
  422. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  423. $<$<BOOL:${WIN32}>:ole32>
  424. $<$<BOOL:${WIN32}>:winmm>
  425. ${CARLA_LIBDL}
  426. )
  427. target_sources(carla-water-files
  428. PRIVATE
  429. ../source/modules/water/water.files.cpp
  430. )
  431. #######################################################################################################################
  432. # ysfx
  433. add_library(carla-ysfx STATIC)
  434. add_library(carla::ysfx ALIAS carla-ysfx)
  435. set_common_target_properties(carla-ysfx)
  436. # YSFX_FTS_LACKS_LFS_SUPPORT
  437. target_compile_definitions(carla-ysfx
  438. PRIVATE
  439. EEL_TARGET_PORTABLE
  440. EELSCRIPT_NO_NET
  441. EELSCRIPT_NO_LICE
  442. NSEEL_ATOF=ysfx_wdl_atof
  443. WDL_FFT_REALSIZE=8
  444. WDL_LINEPARSE_ATOF=ysfx_wdl_atof
  445. WDL_WIN32_UTF8_NO_UI_IMPL
  446. YSFX_API=
  447. YSFX_NO_GFX
  448. YSFX_NO_STANDARD_MUTEX
  449. $<$<BOOL:${WIN32}>:NOMINMAX>
  450. $<$<NOT:$<BOOL:${MINGW}>>:_FILE_OFFSET_BITS=64>
  451. )
  452. # NOTE ugly -U /U due to cmake not supporting `target_remove_definitions`
  453. # see https://gitlab.kitware.com/cmake/cmake/-/issues/19796
  454. target_compile_options(carla-ysfx
  455. PRIVATE
  456. $<$<BOOL:${MINGW}>:-UUNICODE>
  457. $<$<BOOL:${MINGW}>:-U_UNICODE>
  458. $<$<BOOL:${MSVC}>:/wd4018>
  459. $<$<BOOL:${MSVC}>:/wd4297>
  460. $<$<BOOL:${MSVC}>:/UUNICODE>
  461. $<$<BOOL:${MSVC}>:/U_UNICODE>
  462. $<$<C_COMPILER_ID:GNU>:-Wno-extra>
  463. $<$<C_COMPILER_ID:GNU>:-Wno-ignored-attributes>
  464. $<$<C_COMPILER_ID:GNU>:-Wno-unused-function>
  465. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-fsigned-char>
  466. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-sign-compare>
  467. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  468. $<$<AND:$<COMPILE_LANGUAGE:C>,$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>>:-Wno-missing-field-initializers>
  469. $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wno-deprecated-copy>
  470. )
  471. target_include_directories(carla-ysfx
  472. PRIVATE
  473. ../source/modules/ysfx/include
  474. ../source/modules/ysfx/sources
  475. ../source/modules/ysfx/thirdparty/dr_libs
  476. ../source/modules/ysfx/thirdparty/stb
  477. ../source/modules/ysfx/thirdparty/WDL/source
  478. )
  479. target_sources(carla-ysfx
  480. PRIVATE
  481. ../source/modules/ysfx/sources/ysfx.cpp
  482. ../source/modules/ysfx/sources/ysfx_api_eel.cpp
  483. ../source/modules/ysfx/sources/ysfx_api_file.cpp
  484. ../source/modules/ysfx/sources/ysfx_api_gfx.cpp
  485. ../source/modules/ysfx/sources/ysfx_api_reaper.cpp
  486. ../source/modules/ysfx/sources/ysfx_audio_flac.cpp
  487. ../source/modules/ysfx/sources/ysfx_audio_wav.cpp
  488. ../source/modules/ysfx/sources/ysfx_config.cpp
  489. ../source/modules/ysfx/sources/ysfx_eel_utils.cpp
  490. ../source/modules/ysfx/sources/ysfx_midi.cpp
  491. ../source/modules/ysfx/sources/ysfx_parse.cpp
  492. ../source/modules/ysfx/sources/ysfx_reader.cpp
  493. ../source/modules/ysfx/sources/ysfx_utils.cpp
  494. ../source/modules/ysfx/sources/ysfx_utils_fts.cpp
  495. ../source/modules/ysfx/sources/eel2-gas/sources/asm-nseel-x64-sse.S
  496. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-caltab.c
  497. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-cfunc.c
  498. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-compiler.c
  499. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-eval.c
  500. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-lextab.c
  501. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-ram.c
  502. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-yylex.c
  503. ../source/modules/ysfx/thirdparty/WDL/source/WDL/fft.c
  504. $<$<BOOL:${WIN32}>:../source/modules/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c>
  505. )
  506. #######################################################################################################################
  507. # zita-resampler
  508. add_library(carla-zita-resampler STATIC)
  509. add_library(carla::zita-resampler ALIAS carla-zita-resampler)
  510. set_common_target_properties(carla-zita-resampler)
  511. target_include_directories(carla-zita-resampler
  512. PRIVATE
  513. ../source/includes
  514. )
  515. target_sources(carla-zita-resampler
  516. PRIVATE
  517. ../source/modules/zita-resampler/cresampler.cc
  518. ../source/modules/zita-resampler/resampler-table.cc
  519. ../source/modules/zita-resampler/resampler.cc
  520. ../source/modules/zita-resampler/vresampler.cc
  521. )
  522. #######################################################################################################################
  523. # carla bridge
  524. add_executable(carla-bridge-native)
  525. set_common_target_properties(carla-bridge-native)
  526. target_compile_definitions(carla-bridge-native
  527. PRIVATE
  528. BUILD_BRIDGE
  529. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  530. )
  531. # FIXME
  532. target_compile_options(carla-bridge-native
  533. PRIVATE
  534. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  535. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  536. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  537. $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter>
  538. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  539. )
  540. target_include_directories(carla-bridge-native
  541. PRIVATE
  542. ../source
  543. ../source/backend
  544. ../source/backend/engine
  545. ../source/backend/plugin
  546. ../source/includes
  547. ../source/modules
  548. ../source/utils
  549. )
  550. target_link_libraries(carla-bridge-native
  551. PRIVATE
  552. carla-audio-decoder
  553. carla-jackbridge
  554. carla-lilv
  555. carla-native-plugins
  556. carla-rtmempool
  557. carla-sfzero
  558. carla-water
  559. carla-ysfx
  560. carla-zita-resampler
  561. PkgConfig::FLUIDSYNTH
  562. PkgConfig::LIBLO
  563. PkgConfig::LIBMAGIC
  564. PkgConfig::X11
  565. ${CARLA_PTHREADS}
  566. )
  567. target_sources(carla-bridge-native
  568. PRIVATE
  569. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  570. ../source/backend/CarlaStandalone.cpp
  571. ../source/backend/engine/CarlaEngine.cpp
  572. ../source/backend/engine/CarlaEngineBridge.cpp
  573. ../source/backend/engine/CarlaEngineClient.cpp
  574. ../source/backend/engine/CarlaEngineDummy.cpp
  575. ../source/backend/engine/CarlaEngineData.cpp
  576. ../source/backend/engine/CarlaEngineGraph.cpp
  577. ../source/backend/engine/CarlaEngineInternal.cpp
  578. ../source/backend/engine/CarlaEnginePorts.cpp
  579. ../source/backend/engine/CarlaEngineRunner.cpp
  580. ../source/backend/plugin/CarlaPlugin.cpp
  581. ../source/backend/plugin/CarlaPluginBridge.cpp
  582. ../source/backend/plugin/CarlaPluginInternal.cpp
  583. ../source/backend/plugin/CarlaPluginAU.cpp
  584. ../source/backend/plugin/CarlaPluginCLAP.cpp
  585. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  586. ../source/backend/plugin/CarlaPluginJuce.cpp
  587. ../source/backend/plugin/CarlaPluginJSFX.cpp
  588. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  589. ../source/backend/plugin/CarlaPluginLV2.cpp
  590. ../source/backend/plugin/CarlaPluginNative.cpp
  591. ../source/backend/plugin/CarlaPluginSFZero.cpp
  592. ../source/backend/plugin/CarlaPluginVST2.cpp
  593. ../source/backend/plugin/CarlaPluginVST3.cpp
  594. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  595. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  596. )
  597. #######################################################################################################################
  598. # carla discovery
  599. add_executable(carla-discovery-native)
  600. set_common_target_properties(carla-discovery-native)
  601. target_include_directories(carla-discovery-native
  602. PRIVATE
  603. ../source/backend
  604. ../source/includes
  605. ../source/modules
  606. ../source/utils
  607. )
  608. target_link_libraries(carla-discovery-native
  609. PRIVATE
  610. carla-lilv
  611. carla-water-files
  612. carla-ysfx
  613. PkgConfig::FLUIDSYNTH
  614. ${CARLA_PTHREADS}
  615. )
  616. target_sources(carla-discovery-native
  617. PRIVATE
  618. ../source/discovery/carla-discovery.cpp
  619. )
  620. #######################################################################################################################
  621. # carla standalone
  622. add_library(carla-standalone SHARED)
  623. add_library(carla::standalone ALIAS carla-standalone)
  624. set_common_target_properties(carla-standalone)
  625. set_target_properties(carla-standalone
  626. PROPERTIES
  627. OUTPUT_NAME carla_standalone2
  628. )
  629. target_compile_definitions(carla-standalone
  630. PRIVATE
  631. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  632. )
  633. # FIXME
  634. target_compile_options(carla-standalone
  635. PRIVATE
  636. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  637. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  638. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  639. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  640. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  641. )
  642. target_include_directories(carla-standalone
  643. PRIVATE
  644. ../source
  645. ../source/backend
  646. ../source/includes
  647. ../source/modules
  648. ../source/utils
  649. )
  650. target_link_libraries(carla-standalone
  651. PRIVATE
  652. carla-jackbridge
  653. carla-lilv
  654. carla-native-plugins
  655. carla-rtmempool
  656. carla-sfzero
  657. carla-water
  658. carla-ysfx
  659. carla-zita-resampler
  660. PkgConfig::FLUIDSYNTH
  661. PkgConfig::LIBLO
  662. PkgConfig::LIBMAGIC
  663. PkgConfig::X11
  664. ${CARLA_PTHREADS}
  665. )
  666. target_sources(carla-standalone
  667. PRIVATE
  668. ../source/backend/CarlaStandalone.cpp
  669. ../source/backend/CarlaStandaloneNSM.cpp
  670. ../source/backend/engine/CarlaEngine.cpp
  671. ../source/backend/engine/CarlaEngineClient.cpp
  672. ../source/backend/engine/CarlaEngineDummy.cpp
  673. ../source/backend/engine/CarlaEngineData.cpp
  674. ../source/backend/engine/CarlaEngineGraph.cpp
  675. ../source/backend/engine/CarlaEngineInternal.cpp
  676. ../source/backend/engine/CarlaEngineNative.cpp
  677. ../source/backend/engine/CarlaEngineOsc.cpp
  678. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  679. ../source/backend/engine/CarlaEngineOscSend.cpp
  680. ../source/backend/engine/CarlaEnginePorts.cpp
  681. ../source/backend/engine/CarlaEngineRunner.cpp
  682. ../source/backend/plugin/CarlaPlugin.cpp
  683. ../source/backend/plugin/CarlaPluginBridge.cpp
  684. ../source/backend/plugin/CarlaPluginInternal.cpp
  685. ../source/backend/plugin/CarlaPluginAU.cpp
  686. ../source/backend/plugin/CarlaPluginCLAP.cpp
  687. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  688. ../source/backend/plugin/CarlaPluginJuce.cpp
  689. ../source/backend/plugin/CarlaPluginJSFX.cpp
  690. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  691. ../source/backend/plugin/CarlaPluginLV2.cpp
  692. ../source/backend/plugin/CarlaPluginNative.cpp
  693. ../source/backend/plugin/CarlaPluginSFZero.cpp
  694. ../source/backend/plugin/CarlaPluginVST2.cpp
  695. ../source/backend/plugin/CarlaPluginVST3.cpp
  696. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  697. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  698. )
  699. #######################################################################################################################
  700. # carla utils
  701. add_library(carla-utils SHARED)
  702. add_library(carla::utils ALIAS carla-utils)
  703. set_common_target_properties(carla-utils)
  704. set_target_properties(carla-standalone
  705. PROPERTIES
  706. OUTPUT_NAME carla_utils
  707. )
  708. target_include_directories(carla-utils
  709. PRIVATE
  710. ../source
  711. ../source/backend
  712. ../source/includes
  713. ../source/modules
  714. ../source/utils
  715. )
  716. target_link_libraries(carla-utils
  717. PRIVATE
  718. carla-jackbridge
  719. carla-lilv
  720. carla-water-files
  721. carla-ysfx
  722. PkgConfig::FLUIDSYNTH
  723. PkgConfig::X11
  724. ${CARLA_PTHREADS}
  725. )
  726. target_sources(carla-utils
  727. PRIVATE
  728. ../source/backend/utils/CachedPlugins.cpp
  729. ../source/backend/utils/CarlaUtils.cpp
  730. ../source/backend/utils/Information.cpp
  731. ../source/backend/utils/JUCE.cpp
  732. ../source/backend/utils/PipeClient.cpp
  733. ../source/backend/utils/PluginDiscovery.cpp
  734. ../source/backend/utils/System.cpp
  735. ../source/backend/utils/Windows.cpp
  736. )
  737. #######################################################################################################################
  738. if(APPLE)
  739. set_source_files_properties(
  740. ../source/backend/CarlaStandalone.cpp
  741. ../source/backend/plugin/CarlaPluginCLAP.cpp
  742. ../source/backend/plugin/CarlaPluginVST2.cpp
  743. ../source/backend/plugin/CarlaPluginVST3.cpp
  744. ../source/backend/utils/CarlaUtils.cpp
  745. ../source/backend/utils/Windows.cpp
  746. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  747. ../source/discovery/carla-discovery.cpp
  748. ../source/modules/water/water.cpp
  749. ../source/modules/water/water.files.cpp
  750. PROPERTIES COMPILE_FLAGS -ObjC++)
  751. endif()
  752. #######################################################################################################################