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.

1454 lines
43KB

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