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.

1296 lines
38KB

  1. cmake_minimum_required(VERSION 3.15)
  2. project(carla)
  3. set(PROJECT_VERSION 2.6.0-alpha1)
  4. set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
  5. set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
  6. set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
  7. set(CMAKE_C_STANDARD 11)
  8. set(CMAKE_CXX_STANDARD 11)
  9. set(CMAKE_C_VISIBILITY_PRESET hidden)
  10. set(CMAKE_CXX_VISIBILITY_PRESET hidden)
  11. set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
  12. set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
  13. #######################################################################################################################
  14. # fix compat with cmake < 3.26
  15. if(CMAKE_VERSION VERSION_LESS 3.26)
  16. if(MSVC)
  17. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
  18. else()
  19. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
  20. endif()
  21. mark_as_advanced(CMAKE_C_COMPILER_FRONTEND_VARIANT)
  22. endif()
  23. #######################################################################################################################
  24. # build options
  25. if(MSVC)
  26. set(CARLA_USE_JACK_DEFAULT FALSE)
  27. set(CARLA_USE_OSC_DEFAULT FALSE)
  28. else()
  29. set(CARLA_USE_JACK_DEFAULT TRUE)
  30. set(CARLA_USE_OSC_DEFAULT TRUE)
  31. endif()
  32. set(CARLA_BUILD_FRAMEWORKS FALSE CACHE BOOL "Build libraries as macOS frameworks")
  33. set(CARLA_ENABLE_JSFX TRUE CACHE BOOL "Enable JSFX")
  34. set(CARLA_USE_JACK ${CARLA_USE_JACK_DEFAULT} CACHE BOOL "Enable JACK")
  35. set(CARLA_USE_OSC ${CARLA_USE_OSC_DEFAULT} CACHE BOOL "Enable OSC")
  36. if(${CARLA_BUILD_FRAMEWORKS} AND NOT APPLE)
  37. set(CARLA_BUILD_FRAMEWORKS FALSE)
  38. mark_as_advanced(CARLA_BUILD_FRAMEWORKS)
  39. endif()
  40. #######################################################################################################################
  41. # required dependencies
  42. include(GNUInstallDirs)
  43. find_package(Threads REQUIRED)
  44. if(NOT (APPLE OR HAIKU OR WIN32))
  45. set(CARLA_LIBDL dl)
  46. set(CARLA_LIBM m)
  47. set(CARLA_LIBRT rt)
  48. endif()
  49. #######################################################################################################################
  50. # optional dependencies
  51. find_package(PkgConfig QUIET)
  52. # homebrew does not support universal binaries, disable external deps if it is in use
  53. if(APPLE)
  54. find_program(HOMEBREW brew)
  55. if(HOMEBREW)
  56. set(PKGCONFIG_FOUND FALSE)
  57. mark_as_advanced(PKGCONFIG_FOUND)
  58. endif()
  59. endif()
  60. if(PKGCONFIG_FOUND)
  61. pkg_check_modules(FLUIDSYNTH IMPORTED_TARGET fluidsynth)
  62. pkg_check_modules(SNDFILE IMPORTED_TARGET sndfile)
  63. else()
  64. set(FLUIDSYNTH_FOUND FALSE)
  65. set(SNDFILE_FOUND FALSE)
  66. endif()
  67. if(PKGCONFIG_FOUND AND CARLA_USE_OSC)
  68. pkg_check_modules(LIBLO IMPORTED_TARGET liblo)
  69. else()
  70. set(LIBLO_FOUND FALSE)
  71. endif()
  72. if(PKGCONFIG_FOUND AND NOT WIN32)
  73. pkg_check_modules(LIBMAGIC IMPORTED_TARGET libmagic)
  74. else()
  75. set(LIBMAGIC_FOUND FALSE)
  76. endif()
  77. if(PKGCONFIG_FOUND AND NOT (APPLE OR WIN32))
  78. pkg_check_modules(X11 IMPORTED_TARGET x11)
  79. else()
  80. set(X11_FOUND FALSE)
  81. endif()
  82. add_library(carla-none INTERFACE)
  83. if(NOT FLUIDSYNTH_FOUND)
  84. add_library(PkgConfig::FLUIDSYNTH ALIAS carla-none)
  85. endif()
  86. if(NOT LIBLO_FOUND)
  87. add_library(PkgConfig::LIBLO ALIAS carla-none)
  88. endif()
  89. if(NOT LIBMAGIC_FOUND)
  90. add_library(PkgConfig::LIBMAGIC ALIAS carla-none)
  91. endif()
  92. if(NOT SNDFILE_FOUND)
  93. add_library(PkgConfig::SNDFILE ALIAS carla-none)
  94. endif()
  95. if(NOT X11_FOUND)
  96. add_library(PkgConfig::X11 ALIAS carla-none)
  97. endif()
  98. # TODO
  99. set(PYQT_FOUND FALSE)
  100. #######################################################################################################################
  101. # utilities
  102. if(WIN32)
  103. set(CARLA_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
  104. else()
  105. set(CARLA_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}/carla)
  106. endif()
  107. mark_as_advanced(CARLA_INSTALL_LIBDIR)
  108. function(set_common_target_properties TARGET)
  109. target_compile_definitions(${TARGET}
  110. PRIVATE
  111. BUILDING_CARLA
  112. $<$<BOOL:${CARLA_ENABLE_JSFX}>:HAVE_YSFX>
  113. $<$<BOOL:${CARLA_USE_JACK}>:HAVE_JACK>
  114. $<$<BOOL:${FLUIDSYNTH_FOUND}>:HAVE_FLUIDSYNTH>
  115. $<$<BOOL:${LIBLO_FOUND}>:HAVE_LIBLO>
  116. $<$<BOOL:${LIBMAGIC_FOUND}>:HAVE_LIBMAGIC>
  117. $<$<BOOL:${PYQT_FOUND}>:HAVE_PYQT>
  118. $<$<BOOL:${SNDFILE_FOUND}>:HAVE_SNDFILE>
  119. $<$<BOOL:${X11_FOUND}>:HAVE_X11>
  120. )
  121. target_compile_options(${TARGET}
  122. PRIVATE
  123. $<$<BOOL:${MSVC}>:/wd4244>
  124. $<$<BOOL:${MSVC}>:/wd4267>
  125. $<$<BOOL:${MSVC}>:/wd4273>
  126. )
  127. target_link_options(${TARGET}
  128. PRIVATE
  129. $<$<C_COMPILER_ID:GNU>:-Wl,--no-undefined>
  130. )
  131. set_property(TARGET ${TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)
  132. if(APPLE)
  133. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES arm64)
  134. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES x86_64)
  135. endif()
  136. endfunction()
  137. #######################################################################################################################
  138. # setup pthreads for msvc
  139. if(MSVC)
  140. include(FetchContent)
  141. FetchContent_Declare(pthreads4w
  142. GIT_REPOSITORY https://git.code.sf.net/p/pthreads4w/code
  143. GIT_TAG f12b445b336ee0117b43fca1d4b9f22c9af82c36
  144. )
  145. FetchContent_MakeAvailable(pthreads4w)
  146. add_library(pthreads4w STATIC)
  147. add_library(carla::pthreads4w ALIAS pthreads4w)
  148. target_sources(pthreads4w PRIVATE ${pthreads4w_SOURCE_DIR}/pthread.c)
  149. target_compile_definitions(pthreads4w
  150. PRIVATE
  151. HAVE_CONFIG_H
  152. HAVE_STDINT_H=1
  153. _POSIX_C_SOURCE=200112L
  154. PUBLIC
  155. INCLUDE_NP
  156. PTW32_DLLPORT
  157. __PTW32_STATIC_LIB
  158. )
  159. target_include_directories(pthreads4w
  160. PUBLIC
  161. ${pthreads4w_SOURCE_DIR}
  162. )
  163. set(CARLA_PTHREADS carla::pthreads4w)
  164. else()
  165. set(CARLA_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
  166. endif()
  167. #######################################################################################################################
  168. # audio_decoder
  169. add_library(carla-audio-decoder STATIC)
  170. add_library(carla::audio-decoder ALIAS carla-audio-decoder)
  171. set_common_target_properties(carla-audio-decoder)
  172. target_include_directories(carla-audio-decoder
  173. PRIVATE
  174. ../source/includes
  175. ../source/modules
  176. ../source/utils
  177. )
  178. target_link_libraries(carla-audio-decoder
  179. PRIVATE
  180. PkgConfig::SNDFILE
  181. )
  182. target_sources(carla-audio-decoder
  183. PRIVATE
  184. ../source/modules/audio_decoder/ad_dr_mp3.c
  185. ../source/modules/audio_decoder/ad_ffmpeg.c
  186. ../source/modules/audio_decoder/ad_minimp3.c
  187. ../source/modules/audio_decoder/ad_plugin.c
  188. ../source/modules/audio_decoder/ad_soundfile.c
  189. )
  190. #######################################################################################################################
  191. # jackbridge
  192. add_library(carla-jackbridge STATIC)
  193. add_library(carla::jackbridge ALIAS carla-jackbridge)
  194. set_common_target_properties(carla-jackbridge)
  195. target_include_directories(carla-jackbridge
  196. PRIVATE
  197. ../source/includes
  198. ../source/utils
  199. )
  200. target_link_libraries(carla-jackbridge
  201. PRIVATE
  202. ${CARLA_LIBDL}
  203. ${CARLA_LIBRT}
  204. )
  205. target_sources(carla-jackbridge
  206. PRIVATE
  207. ../source/jackbridge/JackBridge1.cpp
  208. ../source/jackbridge/JackBridge2.cpp
  209. )
  210. #######################################################################################################################
  211. # lilv
  212. # serd
  213. add_library(carla-lilv_serd STATIC)
  214. set_common_target_properties(carla-lilv_serd)
  215. target_compile_options(carla-lilv_serd
  216. PRIVATE
  217. $<$<BOOL:${MSVC}>:/wd4005>
  218. $<$<BOOL:${MSVC}>:/wd4090>
  219. $<$<BOOL:${MSVC}>:/wd4133>
  220. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  221. $<$<C_COMPILER_ID:GNU>:-Wno-implicit-fallthrough>
  222. )
  223. target_include_directories(carla-lilv_serd
  224. PRIVATE
  225. ../source/includes
  226. ../source/modules/lilv/config
  227. ../source/modules/lilv/serd-0.24.0
  228. )
  229. target_sources(carla-lilv_serd
  230. PRIVATE
  231. ../source/modules/lilv/serd.c
  232. )
  233. # sord
  234. add_library(carla-lilv_sord STATIC)
  235. set_common_target_properties(carla-lilv_sord)
  236. target_compile_options(carla-lilv_sord
  237. PRIVATE
  238. $<$<BOOL:${MSVC}>:/wd4005>
  239. $<$<BOOL:${MSVC}>:/wd4090>
  240. $<$<BOOL:${MSVC}>:/wd4133>
  241. $<$<C_COMPILER_ID:GNU>:-Wno-maybe-uninitialized>
  242. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  243. # workaround compiler bug, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
  244. $<$<C_COMPILER_ID:GNU>:-fno-strict-aliasing>
  245. )
  246. target_include_directories(carla-lilv_sord
  247. PRIVATE
  248. ../source/includes
  249. ../source/modules/lilv/config
  250. ../source/modules/lilv/sord-0.16.0
  251. ../source/modules/lilv/sord-0.16.0/src
  252. )
  253. target_link_libraries(carla-lilv_sord
  254. PRIVATE
  255. carla-lilv_serd
  256. )
  257. target_sources(carla-lilv_sord
  258. PRIVATE
  259. ../source/modules/lilv/sord.c
  260. )
  261. # sratom
  262. add_library(carla-lilv_sratom STATIC)
  263. set_common_target_properties(carla-lilv_sratom)
  264. target_compile_options(carla-lilv_sratom
  265. PRIVATE
  266. $<$<BOOL:${MSVC}>:/wd4005>
  267. $<$<BOOL:${MSVC}>:/wd4090>
  268. $<$<BOOL:${MSVC}>:/wd4133>
  269. )
  270. target_include_directories(carla-lilv_sratom
  271. PRIVATE
  272. ../source/includes
  273. ../source/modules/lilv/config
  274. ../source/modules/lilv/sratom-0.6.0
  275. )
  276. target_link_libraries(carla-lilv_sratom
  277. PRIVATE
  278. carla-lilv_serd
  279. )
  280. target_sources(carla-lilv_sratom
  281. PRIVATE
  282. ../source/modules/lilv/sratom.c
  283. )
  284. # lilv
  285. add_library(carla-lilv_lilv STATIC)
  286. set_common_target_properties(carla-lilv_lilv)
  287. target_compile_options(carla-lilv_lilv
  288. PRIVATE
  289. $<$<BOOL:${MSVC}>:/wd4005>
  290. $<$<BOOL:${MSVC}>:/wd4090>
  291. $<$<BOOL:${MSVC}>:/wd4133>
  292. $<$<C_COMPILER_ID:AppleClang>:-Wno-incompatible-pointer-types-discards-qualifiers>
  293. $<$<C_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
  294. $<$<C_COMPILER_ID:GNU>:-Wno-discarded-qualifiers>
  295. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  296. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  297. )
  298. target_include_directories(carla-lilv_lilv
  299. PRIVATE
  300. ../source/includes
  301. ../source/modules/lilv/config
  302. ../source/modules/lilv/lilv-0.24.0
  303. ../source/modules/lilv/lilv-0.24.0/src
  304. )
  305. target_link_libraries(carla-lilv_lilv
  306. PRIVATE
  307. carla-lilv_serd
  308. carla-lilv_sord
  309. carla-lilv_sratom
  310. )
  311. target_sources(carla-lilv_lilv
  312. PRIVATE
  313. ../source/modules/lilv/lilv.c
  314. )
  315. # combined target
  316. add_library(carla-lilv INTERFACE)
  317. add_library(carla::lilv ALIAS carla-lilv)
  318. target_link_libraries(carla-lilv
  319. INTERFACE
  320. carla-lilv_serd
  321. carla-lilv_sord
  322. carla-lilv_sratom
  323. carla-lilv_lilv
  324. ${CARLA_LIBDL}
  325. ${CARLA_LIBM}
  326. ${CARLA_LIBRT}
  327. )
  328. #######################################################################################################################
  329. # native-plugins
  330. add_library(carla-native-plugins STATIC)
  331. add_library(carla::native-plugins ALIAS carla-native-plugins)
  332. set_common_target_properties(carla-native-plugins)
  333. target_compile_definitions(carla-native-plugins
  334. PRIVATE
  335. $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
  336. )
  337. target_include_directories(carla-native-plugins
  338. PRIVATE
  339. ../source/includes
  340. ../source/modules
  341. ../source/utils
  342. )
  343. target_link_libraries(carla-native-plugins
  344. PRIVATE
  345. ${CARLA_PTHREADS}
  346. )
  347. target_sources(carla-native-plugins
  348. PRIVATE
  349. ../source/native-plugins/_all.c
  350. ../source/native-plugins/_data.cpp
  351. ../source/native-plugins/audio-gain.c
  352. ../source/native-plugins/bypass.c
  353. ../source/native-plugins/cv-to-audio.c
  354. ../source/native-plugins/lfo.c
  355. ../source/native-plugins/midi-channel-filter.c
  356. ../source/native-plugins/midi-channel-ab.c
  357. ../source/native-plugins/midi-channelize.c
  358. ../source/native-plugins/midi-gain.c
  359. ../source/native-plugins/midi-join.c
  360. ../source/native-plugins/midi-split.c
  361. ../source/native-plugins/midi-to-cv.c
  362. ../source/native-plugins/midi-through.c
  363. ../source/native-plugins/midi-transpose.c
  364. ../source/native-plugins/audio-file.cpp
  365. ../source/native-plugins/midi-file.cpp
  366. # these rely on PyQt
  367. $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/bigmeter.cpp>
  368. $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/midi-pattern.cpp>
  369. $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/notes.cpp>
  370. $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/xycontroller.cpp>
  371. )
  372. #######################################################################################################################
  373. # rtmempool
  374. add_library(carla-rtmempool STATIC)
  375. add_library(carla::rtmempool ALIAS carla-rtmempool)
  376. set_common_target_properties(carla-rtmempool)
  377. target_include_directories(carla-rtmempool
  378. PRIVATE
  379. ../source/includes
  380. ../source/utils
  381. )
  382. target_link_libraries(carla-rtmempool
  383. PRIVATE
  384. ${CARLA_LIBDL}
  385. ${CARLA_LIBRT}
  386. ${CARLA_PTHREADS}
  387. )
  388. target_sources(carla-rtmempool
  389. PRIVATE
  390. ../source/modules/rtmempool/rtmempool.c
  391. )
  392. #######################################################################################################################
  393. # sfzero
  394. add_library(carla-sfzero STATIC)
  395. add_library(carla::sfzero ALIAS carla-sfzero)
  396. set_common_target_properties(carla-sfzero)
  397. target_include_directories(carla-sfzero
  398. PRIVATE
  399. ../source/includes
  400. ../source/modules
  401. ../source/utils
  402. )
  403. target_link_libraries(carla-sfzero
  404. PRIVATE
  405. carla-audio-decoder
  406. ${CARLA_PTHREADS}
  407. )
  408. target_sources(carla-sfzero
  409. PRIVATE
  410. ../source/modules/sfzero/SFZero.cpp
  411. )
  412. #######################################################################################################################
  413. # water
  414. add_library(carla-water STATIC)
  415. add_library(carla::water ALIAS carla-water)
  416. set_common_target_properties(carla-water)
  417. target_compile_options(carla-water
  418. PRIVATE
  419. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  420. )
  421. target_include_directories(carla-water
  422. PRIVATE
  423. ../source/includes
  424. ../source/utils
  425. )
  426. target_link_libraries(carla-water
  427. PRIVATE
  428. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  429. $<$<BOOL:${WIN32}>:comdlg32>
  430. $<$<BOOL:${WIN32}>:ole32>
  431. $<$<BOOL:${WIN32}>:winmm>
  432. ${CARLA_LIBDL}
  433. ${CARLA_LIBRT}
  434. ${CARLA_PTHREADS}
  435. )
  436. target_sources(carla-water
  437. PRIVATE
  438. ../source/modules/water/water.cpp
  439. )
  440. #######################################################################################################################
  441. # water-files
  442. add_library(carla-water-files STATIC)
  443. add_library(carla::water-files ALIAS carla-water-files)
  444. set_common_target_properties(carla-water-files)
  445. target_compile_options(carla-water-files
  446. PRIVATE
  447. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  448. )
  449. target_include_directories(carla-water-files
  450. PRIVATE
  451. ../source/includes
  452. ../source/utils
  453. )
  454. target_link_libraries(carla-water-files
  455. PRIVATE
  456. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  457. $<$<BOOL:${WIN32}>:ole32>
  458. $<$<BOOL:${WIN32}>:winmm>
  459. ${CARLA_LIBDL}
  460. )
  461. target_sources(carla-water-files
  462. PRIVATE
  463. ../source/modules/water/water.files.cpp
  464. )
  465. #######################################################################################################################
  466. # ysfx
  467. if(${CARLA_ENABLE_JSFX})
  468. add_library(carla-ysfx STATIC)
  469. add_library(carla::ysfx ALIAS carla-ysfx)
  470. set_common_target_properties(carla-ysfx)
  471. # YSFX_FTS_LACKS_LFS_SUPPORT
  472. target_compile_definitions(carla-ysfx
  473. PRIVATE
  474. EEL_TARGET_PORTABLE
  475. EELSCRIPT_NO_NET
  476. EELSCRIPT_NO_LICE
  477. NSEEL_ATOF=ysfx_wdl_atof
  478. WDL_FFT_REALSIZE=8
  479. WDL_LINEPARSE_ATOF=ysfx_wdl_atof
  480. WDL_WIN32_UTF8_NO_UI_IMPL
  481. YSFX_API=
  482. YSFX_NO_GFX
  483. YSFX_NO_STANDARD_MUTEX
  484. $<$<BOOL:${WIN32}>:NOMINMAX>
  485. $<$<NOT:$<BOOL:${MINGW}>>:_FILE_OFFSET_BITS=64>
  486. )
  487. # NOTE ugly -U /U due to cmake not supporting `target_remove_definitions`
  488. # see https://gitlab.kitware.com/cmake/cmake/-/issues/19796
  489. target_compile_options(carla-ysfx
  490. PRIVATE
  491. $<$<BOOL:${MINGW}>:-UUNICODE>
  492. $<$<BOOL:${MINGW}>:-U_UNICODE>
  493. $<$<BOOL:${MSVC}>:/wd4018>
  494. $<$<BOOL:${MSVC}>:/wd4297>
  495. $<$<BOOL:${MSVC}>:/UUNICODE>
  496. $<$<BOOL:${MSVC}>:/U_UNICODE>
  497. $<$<C_COMPILER_ID:AppleClang>:-Wno-newline-eof>
  498. $<$<C_COMPILER_ID:GNU>:-Wno-extra>
  499. $<$<C_COMPILER_ID:GNU>:-Wno-ignored-attributes>
  500. $<$<C_COMPILER_ID:GNU>:-Wno-unused-function>
  501. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-fsigned-char>
  502. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-sign-compare>
  503. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  504. $<$<AND:$<COMPILE_LANGUAGE:C>,$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>>:-Wno-missing-field-initializers>
  505. $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wno-deprecated-copy>
  506. )
  507. target_include_directories(carla-ysfx
  508. PRIVATE
  509. ../source/modules/ysfx/include
  510. ../source/modules/ysfx/sources
  511. ../source/modules/ysfx/thirdparty/dr_libs
  512. ../source/modules/ysfx/thirdparty/stb
  513. ../source/modules/ysfx/thirdparty/WDL/source
  514. )
  515. target_sources(carla-ysfx
  516. PRIVATE
  517. ../source/modules/ysfx/sources/ysfx.cpp
  518. ../source/modules/ysfx/sources/ysfx_api_eel.cpp
  519. ../source/modules/ysfx/sources/ysfx_api_file.cpp
  520. ../source/modules/ysfx/sources/ysfx_api_gfx.cpp
  521. ../source/modules/ysfx/sources/ysfx_api_reaper.cpp
  522. ../source/modules/ysfx/sources/ysfx_audio_flac.cpp
  523. ../source/modules/ysfx/sources/ysfx_audio_wav.cpp
  524. ../source/modules/ysfx/sources/ysfx_config.cpp
  525. ../source/modules/ysfx/sources/ysfx_eel_utils.cpp
  526. ../source/modules/ysfx/sources/ysfx_midi.cpp
  527. ../source/modules/ysfx/sources/ysfx_parse.cpp
  528. ../source/modules/ysfx/sources/ysfx_reader.cpp
  529. ../source/modules/ysfx/sources/ysfx_utils.cpp
  530. ../source/modules/ysfx/sources/ysfx_utils_fts.cpp
  531. ../source/modules/ysfx/sources/eel2-gas/sources/asm-nseel-x64-sse.S
  532. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-caltab.c
  533. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-cfunc.c
  534. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-compiler.c
  535. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-eval.c
  536. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-lextab.c
  537. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-ram.c
  538. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-yylex.c
  539. ../source/modules/ysfx/thirdparty/WDL/source/WDL/fft.c
  540. $<$<BOOL:${WIN32}>:../source/modules/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c>
  541. )
  542. endif(${CARLA_ENABLE_JSFX})
  543. #######################################################################################################################
  544. # zita-resampler
  545. add_library(carla-zita-resampler STATIC)
  546. add_library(carla::zita-resampler ALIAS carla-zita-resampler)
  547. set_common_target_properties(carla-zita-resampler)
  548. target_compile_definitions(carla-zita-resampler
  549. PRIVATE
  550. $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
  551. )
  552. target_include_directories(carla-zita-resampler
  553. PRIVATE
  554. ../source/includes
  555. )
  556. target_link_libraries(carla-zita-resampler
  557. PRIVATE
  558. ${CARLA_PTHREADS}
  559. )
  560. target_sources(carla-zita-resampler
  561. PRIVATE
  562. ../source/modules/zita-resampler/cresampler.cc
  563. ../source/modules/zita-resampler/resampler-table.cc
  564. ../source/modules/zita-resampler/resampler.cc
  565. ../source/modules/zita-resampler/vresampler.cc
  566. )
  567. #######################################################################################################################
  568. # carla bridge
  569. add_executable(carla-bridge-native)
  570. set_common_target_properties(carla-bridge-native)
  571. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  572. install(TARGETS carla-bridge-native
  573. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  574. )
  575. endif()
  576. target_compile_definitions(carla-bridge-native
  577. PRIVATE
  578. BUILD_BRIDGE
  579. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  580. )
  581. # FIXME
  582. target_compile_options(carla-bridge-native
  583. PRIVATE
  584. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  585. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  586. $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
  587. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  588. )
  589. target_include_directories(carla-bridge-native
  590. PRIVATE
  591. ../source
  592. ../source/backend
  593. ../source/backend/engine
  594. ../source/backend/plugin
  595. ../source/includes
  596. ../source/modules
  597. ../source/utils
  598. )
  599. target_link_libraries(carla-bridge-native
  600. PRIVATE
  601. carla-audio-decoder
  602. carla-jackbridge
  603. carla-lilv
  604. carla-native-plugins
  605. carla-rtmempool
  606. carla-sfzero
  607. carla-water
  608. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  609. carla-zita-resampler
  610. PkgConfig::FLUIDSYNTH
  611. PkgConfig::LIBLO
  612. PkgConfig::LIBMAGIC
  613. PkgConfig::X11
  614. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  615. ${CARLA_PTHREADS}
  616. )
  617. target_sources(carla-bridge-native
  618. PRIVATE
  619. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  620. ../source/backend/CarlaStandalone.cpp
  621. ../source/backend/engine/CarlaEngine.cpp
  622. ../source/backend/engine/CarlaEngineBridge.cpp
  623. ../source/backend/engine/CarlaEngineClient.cpp
  624. ../source/backend/engine/CarlaEngineDummy.cpp
  625. ../source/backend/engine/CarlaEngineData.cpp
  626. ../source/backend/engine/CarlaEngineGraph.cpp
  627. ../source/backend/engine/CarlaEngineInternal.cpp
  628. ../source/backend/engine/CarlaEnginePorts.cpp
  629. ../source/backend/engine/CarlaEngineRunner.cpp
  630. ../source/backend/plugin/CarlaPlugin.cpp
  631. ../source/backend/plugin/CarlaPluginBridge.cpp
  632. ../source/backend/plugin/CarlaPluginInternal.cpp
  633. ../source/backend/plugin/CarlaPluginAU.cpp
  634. ../source/backend/plugin/CarlaPluginCLAP.cpp
  635. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  636. ../source/backend/plugin/CarlaPluginJuce.cpp
  637. ../source/backend/plugin/CarlaPluginJSFX.cpp
  638. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  639. ../source/backend/plugin/CarlaPluginLV2.cpp
  640. ../source/backend/plugin/CarlaPluginNative.cpp
  641. ../source/backend/plugin/CarlaPluginSFZero.cpp
  642. ../source/backend/plugin/CarlaPluginVST2.cpp
  643. ../source/backend/plugin/CarlaPluginVST3.cpp
  644. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  645. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  646. )
  647. #######################################################################################################################
  648. # carla discovery
  649. add_executable(carla-discovery-native)
  650. set_common_target_properties(carla-discovery-native)
  651. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  652. install(TARGETS carla-discovery-native
  653. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  654. )
  655. endif()
  656. target_include_directories(carla-discovery-native
  657. PRIVATE
  658. ../source/backend
  659. ../source/includes
  660. ../source/modules
  661. ../source/utils
  662. )
  663. target_link_libraries(carla-discovery-native
  664. PRIVATE
  665. carla-lilv
  666. carla-water-files
  667. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  668. PkgConfig::FLUIDSYNTH
  669. ${CARLA_PTHREADS}
  670. )
  671. target_sources(carla-discovery-native
  672. PRIVATE
  673. ../source/discovery/carla-discovery.cpp
  674. )
  675. #######################################################################################################################
  676. # carla native-plugin
  677. add_library(carla-native-plugin SHARED)
  678. add_library(carla::standalone ALIAS carla-native-plugin)
  679. set_common_target_properties(carla-native-plugin)
  680. if(${CARLA_BUILD_FRAMEWORKS})
  681. set(carla-native-plugin-public-headers
  682. ../source/backend/CarlaBackend.h
  683. ../source/backend/CarlaHost.h
  684. ../source/backend/CarlaUtils.h
  685. ../source/includes/CarlaDefines.h
  686. ../source/includes/CarlaNative.h
  687. ../source/includes/CarlaNativePlugin.h
  688. )
  689. set_target_properties(carla-native-plugin
  690. PROPERTIES
  691. FRAMEWORK TRUE
  692. OUTPUT_NAME carla_native-plugin
  693. PUBLIC_HEADER "${carla-native-plugin-public-headers}"
  694. )
  695. else()
  696. set_target_properties(carla-native-plugin
  697. PROPERTIES
  698. OUTPUT_NAME carla_native-plugin
  699. IMPORT_PREFIX lib
  700. PREFIX lib
  701. )
  702. endif()
  703. target_compile_definitions(carla-native-plugin
  704. PRIVATE
  705. CARLA_PLUGIN_BUILD
  706. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  707. )
  708. # FIXME
  709. # target_compile_options(carla-native-plugin
  710. # PRIVATE
  711. # $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  712. # )
  713. target_include_directories(carla-native-plugin
  714. PRIVATE
  715. ../source
  716. ../source/backend
  717. ../source/includes
  718. ../source/modules
  719. ../source/utils
  720. )
  721. if(APPLE)
  722. target_link_options(carla-native-plugin
  723. PRIVATE
  724. -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
  725. -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
  726. -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
  727. -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
  728. -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
  729. -Wl,-exported_symbol,_carla_get_native_patchbay_cv8_plugin
  730. -Wl,-exported_symbol,_carla_get_native_patchbay_cv32_plugin
  731. -Wl,-exported_symbol,_carla_get_native_patchbay_obs_plugin
  732. -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
  733. -Wl,-exported_symbol,_carla_host_handle_free
  734. -Wl,-exported_symbol,_carla_get_native_plugin_engine
  735. -Wl,-exported_symbol,_carla_get_complete_license_text
  736. -Wl,-exported_symbol,_carla_get_juce_version
  737. -Wl,-exported_symbol,_carla_get_supported_file_extensions
  738. -Wl,-exported_symbol,_carla_get_supported_features
  739. -Wl,-exported_symbol,_carla_get_library_filename
  740. -Wl,-exported_symbol,_carla_get_library_folder
  741. )
  742. elseif(EMSCRIPTEN)
  743. target_link_options(carla-native-plugin
  744. PRIVATE
  745. -sSIDE_MODULE=2
  746. -sEXPORTED_FUNCTIONS="['carla_get_native_rack_plugin','carla_get_native_patchbay_plugin','carla_get_native_patchbay16_plugin','carla_get_native_patchbay32_plugin','carla_get_native_patchbay64_plugin','carla_get_native_patchbay_cv_plugin','carla_get_native_patchbay_cv8_plugin','carla_get_native_patchbay_cv32_plugin','carla_get_native_patchbay_obs_plugin','carla_create_native_plugin_host_handle','carla_host_handle_free','carla_get_native_plugin_engine','carla_get_complete_license_text','carla_get_juce_version','carla_get_supported_file_extensions','carla_get_supported_features','carla_get_library_filename','carla_get_library_folder']"
  747. )
  748. elseif(MSVC)
  749. target_link_options(carla-native-plugin
  750. PRIVATE
  751. /DEF:../source/plugin/symbols/carla-native-plugin.def
  752. )
  753. elseif(WIN32)
  754. target_link_options(carla-native-plugin
  755. PRIVATE
  756. ../source/plugin/symbols/carla-native-plugin.def
  757. )
  758. else()
  759. target_link_options(carla-native-plugin
  760. PRIVATE
  761. -Wl,--version-script=../source/plugin/symbols/carla-native-plugin.version
  762. )
  763. endif()
  764. target_link_libraries(carla-native-plugin
  765. PRIVATE
  766. carla-jackbridge
  767. carla-lilv
  768. carla-native-plugins
  769. carla-rtmempool
  770. carla-sfzero
  771. carla-water
  772. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  773. carla-zita-resampler
  774. PkgConfig::FLUIDSYNTH
  775. PkgConfig::LIBLO
  776. PkgConfig::LIBMAGIC
  777. PkgConfig::X11
  778. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  779. ${CARLA_PTHREADS}
  780. )
  781. target_sources(carla-native-plugin
  782. PRIVATE
  783. ../source/backend/engine/CarlaEngine.cpp
  784. ../source/backend/engine/CarlaEngineClient.cpp
  785. ../source/backend/engine/CarlaEngineData.cpp
  786. ../source/backend/engine/CarlaEngineGraph.cpp
  787. ../source/backend/engine/CarlaEngineInternal.cpp
  788. ../source/backend/engine/CarlaEngineNative.cpp
  789. ../source/backend/engine/CarlaEngineOsc.cpp
  790. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  791. ../source/backend/engine/CarlaEngineOscSend.cpp
  792. ../source/backend/engine/CarlaEnginePorts.cpp
  793. ../source/backend/engine/CarlaEngineRunner.cpp
  794. ../source/backend/plugin/CarlaPlugin.cpp
  795. ../source/backend/plugin/CarlaPluginBridge.cpp
  796. ../source/backend/plugin/CarlaPluginInternal.cpp
  797. ../source/backend/plugin/CarlaPluginAU.cpp
  798. ../source/backend/plugin/CarlaPluginCLAP.cpp
  799. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  800. ../source/backend/plugin/CarlaPluginJuce.cpp
  801. ../source/backend/plugin/CarlaPluginJSFX.cpp
  802. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  803. ../source/backend/plugin/CarlaPluginLV2.cpp
  804. ../source/backend/plugin/CarlaPluginNative.cpp
  805. ../source/backend/plugin/CarlaPluginSFZero.cpp
  806. ../source/backend/plugin/CarlaPluginVST2.cpp
  807. ../source/backend/plugin/CarlaPluginVST3.cpp
  808. ../source/plugin/carla-native-plugin.cpp
  809. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  810. PUBLIC
  811. ${carla-native-plugin-public-headers}
  812. )
  813. install(TARGETS carla-native-plugin
  814. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  815. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  816. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  817. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  818. )
  819. # if(${CARLA_BUILD_FRAMEWORKS})
  820. # install(TARGETS
  821. # carla-bridge-native
  822. # carla-discovery-native
  823. # DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-native-plugin.framework)
  824. # endif()
  825. #######################################################################################################################
  826. # carla standalone
  827. add_library(carla-standalone SHARED)
  828. add_library(carla::standalone ALIAS carla-standalone)
  829. set_common_target_properties(carla-standalone)
  830. if(${CARLA_BUILD_FRAMEWORKS})
  831. set(carla-standalone-public-headers
  832. ../source/backend/CarlaBackend.h
  833. ../source/backend/CarlaHost.h
  834. ../source/backend/CarlaEngine.hpp
  835. ../source/backend/CarlaPlugin.hpp
  836. ../source/backend/CarlaPluginPtr.hpp
  837. ../source/includes/CarlaDefines.h
  838. ../source/utils/CarlaUtils.hpp
  839. )
  840. set_target_properties(carla-standalone
  841. PROPERTIES
  842. FRAMEWORK TRUE
  843. OUTPUT_NAME carla-standalone
  844. PUBLIC_HEADER "${carla-standalone-public-headers}"
  845. )
  846. else()
  847. set_target_properties(carla-standalone
  848. PROPERTIES
  849. OUTPUT_NAME carla_standalone2
  850. IMPORT_PREFIX lib
  851. PREFIX lib
  852. )
  853. endif()
  854. target_compile_definitions(carla-standalone
  855. PRIVATE
  856. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  857. )
  858. # FIXME
  859. target_compile_options(carla-standalone
  860. PRIVATE
  861. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  862. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  863. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  864. $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
  865. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  866. )
  867. target_include_directories(carla-standalone
  868. PRIVATE
  869. ../source
  870. ../source/backend
  871. ../source/includes
  872. ../source/modules
  873. ../source/utils
  874. )
  875. target_link_libraries(carla-standalone
  876. PRIVATE
  877. carla-jackbridge
  878. carla-lilv
  879. carla-native-plugins
  880. carla-rtmempool
  881. carla-sfzero
  882. carla-water
  883. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  884. carla-zita-resampler
  885. PkgConfig::FLUIDSYNTH
  886. PkgConfig::LIBLO
  887. PkgConfig::LIBMAGIC
  888. PkgConfig::X11
  889. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  890. ${CARLA_PTHREADS}
  891. )
  892. target_sources(carla-standalone
  893. PRIVATE
  894. ../source/backend/CarlaStandalone.cpp
  895. ../source/backend/CarlaStandaloneNSM.cpp
  896. ../source/backend/engine/CarlaEngine.cpp
  897. ../source/backend/engine/CarlaEngineClient.cpp
  898. ../source/backend/engine/CarlaEngineDummy.cpp
  899. ../source/backend/engine/CarlaEngineData.cpp
  900. ../source/backend/engine/CarlaEngineGraph.cpp
  901. ../source/backend/engine/CarlaEngineInternal.cpp
  902. ../source/backend/engine/CarlaEngineNative.cpp
  903. ../source/backend/engine/CarlaEngineOsc.cpp
  904. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  905. ../source/backend/engine/CarlaEngineOscSend.cpp
  906. ../source/backend/engine/CarlaEnginePorts.cpp
  907. ../source/backend/engine/CarlaEngineRunner.cpp
  908. ../source/backend/plugin/CarlaPlugin.cpp
  909. ../source/backend/plugin/CarlaPluginBridge.cpp
  910. ../source/backend/plugin/CarlaPluginInternal.cpp
  911. ../source/backend/plugin/CarlaPluginAU.cpp
  912. ../source/backend/plugin/CarlaPluginCLAP.cpp
  913. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  914. ../source/backend/plugin/CarlaPluginJuce.cpp
  915. ../source/backend/plugin/CarlaPluginJSFX.cpp
  916. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  917. ../source/backend/plugin/CarlaPluginLV2.cpp
  918. ../source/backend/plugin/CarlaPluginNative.cpp
  919. ../source/backend/plugin/CarlaPluginSFZero.cpp
  920. ../source/backend/plugin/CarlaPluginVST2.cpp
  921. ../source/backend/plugin/CarlaPluginVST3.cpp
  922. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  923. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  924. PUBLIC
  925. ${carla-standalone-public-headers}
  926. )
  927. install(TARGETS carla-standalone
  928. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  929. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  930. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  931. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  932. )
  933. if(${CARLA_BUILD_FRAMEWORKS})
  934. install(TARGETS
  935. carla-bridge-native
  936. carla-discovery-native
  937. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework)
  938. endif()
  939. #######################################################################################################################
  940. # carla utils
  941. add_library(carla-utils SHARED)
  942. add_library(carla::utils ALIAS carla-utils)
  943. set_common_target_properties(carla-utils)
  944. if(${CARLA_BUILD_FRAMEWORKS})
  945. set(carla-utils-public-headers
  946. ../source/backend/CarlaBackend.h
  947. ../source/backend/CarlaUtils.h
  948. ../source/includes/CarlaDefines.h
  949. ../source/includes/CarlaMIDI.h
  950. ../source/utils/CarlaBackendUtils.hpp
  951. ../source/utils/CarlaBase64Utils.hpp
  952. ../source/utils/CarlaBinaryUtils.hpp
  953. ../source/utils/CarlaBridgeDefines.hpp
  954. ../source/utils/CarlaBridgeUtils.hpp
  955. ../source/utils/CarlaMacUtils.hpp
  956. ../source/utils/CarlaMathUtils.hpp
  957. ../source/utils/CarlaMutex.hpp
  958. ../source/utils/CarlaRingBuffer.hpp
  959. ../source/utils/CarlaProcessUtils.hpp
  960. ../source/utils/CarlaRunner.hpp
  961. ../source/utils/CarlaScopeUtils.hpp
  962. ../source/utils/CarlaSemUtils.hpp
  963. ../source/utils/CarlaSha1Utils.hpp
  964. ../source/utils/CarlaShmUtils.hpp
  965. ../source/utils/CarlaString.hpp
  966. ../source/utils/CarlaThread.hpp
  967. ../source/utils/CarlaTimeUtils.hpp
  968. ../source/utils/CarlaUtils.hpp
  969. )
  970. set_target_properties(carla-utils
  971. PROPERTIES
  972. FRAMEWORK TRUE
  973. OUTPUT_NAME carla-utils
  974. PUBLIC_HEADER "${carla-utils-public-headers}"
  975. )
  976. else()
  977. set_target_properties(carla-utils
  978. PROPERTIES
  979. OUTPUT_NAME carla_utils
  980. IMPORT_PREFIX lib
  981. PREFIX lib
  982. )
  983. endif()
  984. target_include_directories(carla-utils
  985. PRIVATE
  986. ../source
  987. ../source/backend
  988. ../source/includes
  989. ../source/modules
  990. ../source/utils
  991. )
  992. target_link_libraries(carla-utils
  993. PRIVATE
  994. carla-jackbridge
  995. carla-lilv
  996. carla-water-files
  997. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  998. PkgConfig::FLUIDSYNTH
  999. PkgConfig::X11
  1000. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  1001. ${CARLA_PTHREADS}
  1002. PUBLIC
  1003. $<$<BOOL:${WIN32}>:winmm>
  1004. )
  1005. target_sources(carla-utils
  1006. PRIVATE
  1007. ../source/backend/utils/CachedPlugins.cpp
  1008. ../source/backend/utils/CarlaUtils.cpp
  1009. ../source/backend/utils/Information.cpp
  1010. ../source/backend/utils/JUCE.cpp
  1011. ../source/backend/utils/PipeClient.cpp
  1012. ../source/backend/utils/PluginDiscovery.cpp
  1013. ../source/backend/utils/System.cpp
  1014. ../source/backend/utils/Windows.cpp
  1015. PUBLIC
  1016. ${carla-utils-public-headers}
  1017. )
  1018. install(TARGETS carla-utils
  1019. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1020. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1021. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  1022. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1023. )
  1024. if(${CARLA_BUILD_FRAMEWORKS})
  1025. install(TARGETS
  1026. carla-bridge-native
  1027. carla-discovery-native
  1028. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework)
  1029. endif()
  1030. #######################################################################################################################
  1031. if(APPLE)
  1032. set_source_files_properties(
  1033. ../source/backend/CarlaStandalone.cpp
  1034. ../source/backend/engine/CarlaEngineNative.cpp
  1035. ../source/backend/plugin/CarlaPluginCLAP.cpp
  1036. ../source/backend/plugin/CarlaPluginVST2.cpp
  1037. ../source/backend/plugin/CarlaPluginVST3.cpp
  1038. ../source/backend/utils/CarlaUtils.cpp
  1039. ../source/backend/utils/Windows.cpp
  1040. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  1041. ../source/discovery/carla-discovery.cpp
  1042. ../source/modules/water/water.cpp
  1043. ../source/modules/water/water.files.cpp
  1044. PROPERTIES COMPILE_FLAGS -ObjC++)
  1045. endif()
  1046. #######################################################################################################################
  1047. # install code headers
  1048. add_library(carla-headers-backend INTERFACE)
  1049. add_library(carla-headers-includes INTERFACE)
  1050. add_library(carla-headers-utils INTERFACE)
  1051. set_property(TARGET carla-headers-backend
  1052. PROPERTY PUBLIC_HEADER
  1053. ../source/backend/CarlaBackend.h
  1054. ../source/backend/CarlaHost.h
  1055. ../source/backend/CarlaUtils.h
  1056. ../source/backend/CarlaEngine.hpp
  1057. ../source/backend/CarlaPlugin.hpp
  1058. ../source/backend/CarlaPluginPtr.hpp
  1059. )
  1060. set_property(TARGET carla-headers-includes
  1061. PROPERTY PUBLIC_HEADER
  1062. ../source/includes/CarlaDefines.h
  1063. ../source/includes/CarlaMIDI.h
  1064. ../source/includes/CarlaNative.h
  1065. ../source/includes/CarlaNativePlugin.h
  1066. )
  1067. set_property(TARGET carla-headers-utils
  1068. PROPERTY PUBLIC_HEADER
  1069. ../source/utils/CarlaBackendUtils.hpp
  1070. ../source/utils/CarlaBase64Utils.hpp
  1071. ../source/utils/CarlaBinaryUtils.hpp
  1072. ../source/utils/CarlaBridgeDefines.hpp
  1073. ../source/utils/CarlaBridgeUtils.hpp
  1074. ../source/utils/CarlaMacUtils.hpp
  1075. ../source/utils/CarlaMathUtils.hpp
  1076. ../source/utils/CarlaMutex.hpp
  1077. ../source/utils/CarlaRingBuffer.hpp
  1078. ../source/utils/CarlaProcessUtils.hpp
  1079. ../source/utils/CarlaRunner.hpp
  1080. ../source/utils/CarlaScopeUtils.hpp
  1081. ../source/utils/CarlaSemUtils.hpp
  1082. ../source/utils/CarlaSha1Utils.hpp
  1083. ../source/utils/CarlaShmUtils.hpp
  1084. ../source/utils/CarlaString.hpp
  1085. ../source/utils/CarlaThread.hpp
  1086. ../source/utils/CarlaTimeUtils.hpp
  1087. ../source/utils/CarlaUtils.hpp
  1088. )
  1089. install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
  1090. install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
  1091. install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
  1092. #######################################################################################################################
  1093. # pkg-config stuff
  1094. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  1095. configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
  1096. install(FILES
  1097. ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
  1098. DESTINATION
  1099. ${CMAKE_INSTALL_LIBDIR}/pkgconfig
  1100. )
  1101. endif()
  1102. #######################################################################################################################