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.

1437 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. ../source/includes/CarlaDefines.h
  762. ../source/includes/CarlaNative.h
  763. ../source/includes/CarlaNativePlugin.h
  764. )
  765. set_target_properties(carla-native-plugin
  766. PROPERTIES
  767. FRAMEWORK TRUE
  768. FRAMEWORK_VERSION A
  769. OUTPUT_NAME carla-native-plugin
  770. PUBLIC_HEADER "${carla-native-plugin-public-headers}"
  771. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  772. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.native-plugin"
  773. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  774. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  775. )
  776. else()
  777. set_target_properties(carla-native-plugin
  778. PROPERTIES
  779. OUTPUT_NAME carla_native-plugin
  780. IMPORT_PREFIX lib
  781. PREFIX lib
  782. )
  783. endif()
  784. target_compile_definitions(carla-native-plugin
  785. PRIVATE
  786. CARLA_PLUGIN_BUILD
  787. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  788. )
  789. # FIXME
  790. # target_compile_options(carla-native-plugin
  791. # PRIVATE
  792. # $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  793. # )
  794. target_include_directories(carla-native-plugin
  795. PRIVATE
  796. ../source
  797. ../source/backend
  798. ../source/includes
  799. ../source/modules
  800. ../source/utils
  801. )
  802. if(APPLE)
  803. target_link_options(carla-native-plugin
  804. PRIVATE
  805. -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
  806. -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
  807. -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
  808. -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
  809. -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
  810. -Wl,-exported_symbol,_carla_get_native_patchbay_cv8_plugin
  811. -Wl,-exported_symbol,_carla_get_native_patchbay_cv32_plugin
  812. -Wl,-exported_symbol,_carla_get_native_patchbay_obs_plugin
  813. -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
  814. -Wl,-exported_symbol,_carla_host_handle_free
  815. -Wl,-exported_symbol,_carla_get_native_plugin_engine
  816. -Wl,-exported_symbol,_carla_get_complete_license_text
  817. -Wl,-exported_symbol,_carla_get_juce_version
  818. -Wl,-exported_symbol,_carla_get_supported_file_extensions
  819. -Wl,-exported_symbol,_carla_get_supported_features
  820. -Wl,-exported_symbol,_carla_get_library_filename
  821. -Wl,-exported_symbol,_carla_get_library_folder
  822. )
  823. elseif(EMSCRIPTEN)
  824. target_link_options(carla-native-plugin
  825. PRIVATE
  826. -sSIDE_MODULE=2
  827. -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']"
  828. )
  829. elseif(MSVC)
  830. target_link_options(carla-native-plugin
  831. PRIVATE
  832. /DEF:${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
  833. )
  834. elseif(WIN32)
  835. target_link_options(carla-native-plugin
  836. PRIVATE
  837. ${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
  838. )
  839. else()
  840. target_link_options(carla-native-plugin
  841. PRIVATE
  842. -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.version
  843. )
  844. endif()
  845. target_link_libraries(carla-native-plugin
  846. PRIVATE
  847. carla-jackbridge
  848. carla-lilv
  849. carla-native-plugins
  850. carla-rtmempool
  851. carla-sfzero
  852. carla-water
  853. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  854. carla-zita-resampler
  855. PkgConfig::FLUIDSYNTH
  856. PkgConfig::LIBLO
  857. PkgConfig::LIBMAGIC
  858. PkgConfig::X11
  859. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  860. ${CARLA_PTHREADS}
  861. )
  862. target_sources(carla-native-plugin
  863. PRIVATE
  864. ../source/backend/engine/CarlaEngine.cpp
  865. ../source/backend/engine/CarlaEngineClient.cpp
  866. ../source/backend/engine/CarlaEngineData.cpp
  867. ../source/backend/engine/CarlaEngineGraph.cpp
  868. ../source/backend/engine/CarlaEngineInternal.cpp
  869. ../source/backend/engine/CarlaEngineNative.cpp
  870. ../source/backend/engine/CarlaEngineOsc.cpp
  871. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  872. ../source/backend/engine/CarlaEngineOscSend.cpp
  873. ../source/backend/engine/CarlaEnginePorts.cpp
  874. ../source/backend/engine/CarlaEngineRunner.cpp
  875. ../source/backend/plugin/CarlaPlugin.cpp
  876. ../source/backend/plugin/CarlaPluginBridge.cpp
  877. ../source/backend/plugin/CarlaPluginInternal.cpp
  878. ../source/backend/plugin/CarlaPluginAU.cpp
  879. ../source/backend/plugin/CarlaPluginCLAP.cpp
  880. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  881. ../source/backend/plugin/CarlaPluginJuce.cpp
  882. ../source/backend/plugin/CarlaPluginJSFX.cpp
  883. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  884. ../source/backend/plugin/CarlaPluginLV2.cpp
  885. ../source/backend/plugin/CarlaPluginNative.cpp
  886. ../source/backend/plugin/CarlaPluginSFZero.cpp
  887. ../source/backend/plugin/CarlaPluginVST2.cpp
  888. ../source/backend/plugin/CarlaPluginVST3.cpp
  889. ../source/plugin/carla-native-plugin.cpp
  890. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  891. PUBLIC
  892. ${carla-native-plugin-public-headers}
  893. )
  894. install(TARGETS carla-native-plugin
  895. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  896. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  897. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  898. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  899. )
  900. #######################################################################################################################
  901. # carla standalone
  902. add_library(carla-standalone SHARED)
  903. add_library(carla::standalone ALIAS carla-standalone)
  904. set_common_target_properties(carla-standalone)
  905. if(${CARLA_BUILD_FRAMEWORKS})
  906. set(carla-standalone-public-headers
  907. ../source/backend/CarlaBackend.h
  908. ../source/backend/CarlaHost.h
  909. ../source/backend/CarlaEngine.hpp
  910. ../source/backend/CarlaPlugin.hpp
  911. ../source/backend/CarlaPluginPtr.hpp
  912. ../source/includes/CarlaDefines.h
  913. ../source/utils/CarlaUtils.hpp
  914. )
  915. set_target_properties(carla-standalone
  916. PROPERTIES
  917. FRAMEWORK TRUE
  918. FRAMEWORK_VERSION A
  919. OUTPUT_NAME carla-standalone
  920. PUBLIC_HEADER "${carla-standalone-public-headers}"
  921. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  922. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.standalone"
  923. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  924. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  925. )
  926. else()
  927. set_target_properties(carla-standalone
  928. PROPERTIES
  929. OUTPUT_NAME carla_standalone2
  930. IMPORT_PREFIX lib
  931. PREFIX lib
  932. )
  933. endif()
  934. target_compile_definitions(carla-standalone
  935. PRIVATE
  936. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  937. )
  938. # FIXME
  939. target_compile_options(carla-standalone
  940. PRIVATE
  941. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  942. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  943. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  944. $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
  945. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  946. )
  947. target_include_directories(carla-standalone
  948. PRIVATE
  949. ../source
  950. ../source/backend
  951. ../source/includes
  952. ../source/modules
  953. ../source/utils
  954. )
  955. target_link_libraries(carla-standalone
  956. PRIVATE
  957. carla-jackbridge
  958. carla-lilv
  959. carla-native-plugins
  960. carla-rtmempool
  961. carla-sfzero
  962. carla-water
  963. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  964. carla-zita-resampler
  965. PkgConfig::FLUIDSYNTH
  966. PkgConfig::LIBLO
  967. PkgConfig::LIBMAGIC
  968. PkgConfig::X11
  969. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  970. ${CARLA_PTHREADS}
  971. )
  972. target_sources(carla-standalone
  973. PRIVATE
  974. ../source/backend/CarlaStandalone.cpp
  975. ../source/backend/CarlaStandaloneNSM.cpp
  976. ../source/backend/engine/CarlaEngine.cpp
  977. ../source/backend/engine/CarlaEngineClient.cpp
  978. ../source/backend/engine/CarlaEngineDummy.cpp
  979. ../source/backend/engine/CarlaEngineData.cpp
  980. ../source/backend/engine/CarlaEngineGraph.cpp
  981. ../source/backend/engine/CarlaEngineInternal.cpp
  982. ../source/backend/engine/CarlaEngineNative.cpp
  983. ../source/backend/engine/CarlaEngineOsc.cpp
  984. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  985. ../source/backend/engine/CarlaEngineOscSend.cpp
  986. ../source/backend/engine/CarlaEnginePorts.cpp
  987. ../source/backend/engine/CarlaEngineRunner.cpp
  988. ../source/backend/plugin/CarlaPlugin.cpp
  989. ../source/backend/plugin/CarlaPluginBridge.cpp
  990. ../source/backend/plugin/CarlaPluginInternal.cpp
  991. ../source/backend/plugin/CarlaPluginAU.cpp
  992. ../source/backend/plugin/CarlaPluginCLAP.cpp
  993. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  994. ../source/backend/plugin/CarlaPluginJuce.cpp
  995. ../source/backend/plugin/CarlaPluginJSFX.cpp
  996. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  997. ../source/backend/plugin/CarlaPluginLV2.cpp
  998. ../source/backend/plugin/CarlaPluginNative.cpp
  999. ../source/backend/plugin/CarlaPluginSFZero.cpp
  1000. ../source/backend/plugin/CarlaPluginVST2.cpp
  1001. ../source/backend/plugin/CarlaPluginVST3.cpp
  1002. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  1003. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  1004. PUBLIC
  1005. ${carla-standalone-public-headers}
  1006. )
  1007. install(TARGETS carla-standalone
  1008. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1009. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1010. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1011. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  1012. )
  1013. if(${CARLA_BUILD_FRAMEWORKS})
  1014. install(TARGETS
  1015. carla-bridge-lv2-gtk2
  1016. carla-bridge-lv2-gtk3
  1017. carla-bridge-native
  1018. carla-discovery-native
  1019. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A)
  1020. install(CODE
  1021. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1022. Versions/A/carla-bridge-lv2-gtk2
  1023. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk2)")
  1024. install(CODE
  1025. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1026. Versions/A/carla-bridge-lv2-gtk3
  1027. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk3)")
  1028. install(CODE
  1029. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1030. Versions/A/carla-bridge-native
  1031. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-native)")
  1032. install(CODE
  1033. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1034. Versions/A/carla-discovery-native
  1035. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-discovery-native)")
  1036. endif()
  1037. #######################################################################################################################
  1038. # carla utils
  1039. add_library(carla-utils SHARED)
  1040. add_library(carla::utils ALIAS carla-utils)
  1041. set_common_target_properties(carla-utils)
  1042. if(${CARLA_BUILD_FRAMEWORKS})
  1043. set(carla-utils-public-headers
  1044. ../source/backend/CarlaBackend.h
  1045. ../source/backend/CarlaUtils.h
  1046. ../source/includes/CarlaDefines.h
  1047. ../source/includes/CarlaMIDI.h
  1048. ../source/utils/CarlaBackendUtils.hpp
  1049. ../source/utils/CarlaBase64Utils.hpp
  1050. ../source/utils/CarlaBinaryUtils.hpp
  1051. ../source/utils/CarlaBridgeDefines.hpp
  1052. ../source/utils/CarlaBridgeUtils.hpp
  1053. ../source/utils/CarlaMacUtils.hpp
  1054. ../source/utils/CarlaMathUtils.hpp
  1055. ../source/utils/CarlaMutex.hpp
  1056. ../source/utils/CarlaRingBuffer.hpp
  1057. ../source/utils/CarlaProcessUtils.hpp
  1058. ../source/utils/CarlaRunner.hpp
  1059. ../source/utils/CarlaScopeUtils.hpp
  1060. ../source/utils/CarlaSemUtils.hpp
  1061. ../source/utils/CarlaSha1Utils.hpp
  1062. ../source/utils/CarlaShmUtils.hpp
  1063. ../source/utils/CarlaString.hpp
  1064. ../source/utils/CarlaThread.hpp
  1065. ../source/utils/CarlaTimeUtils.hpp
  1066. ../source/utils/CarlaUtils.hpp
  1067. )
  1068. set_target_properties(carla-utils
  1069. PROPERTIES
  1070. FRAMEWORK TRUE
  1071. FRAMEWORK_VERSION A
  1072. OUTPUT_NAME carla-utils
  1073. PUBLIC_HEADER "${carla-utils-public-headers}"
  1074. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  1075. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.utils"
  1076. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  1077. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  1078. )
  1079. else()
  1080. set_target_properties(carla-utils
  1081. PROPERTIES
  1082. OUTPUT_NAME carla_utils
  1083. IMPORT_PREFIX lib
  1084. PREFIX lib
  1085. )
  1086. endif()
  1087. target_include_directories(carla-utils
  1088. PRIVATE
  1089. ../source
  1090. ../source/backend
  1091. ../source/includes
  1092. ../source/modules
  1093. ../source/utils
  1094. )
  1095. target_link_libraries(carla-utils
  1096. PRIVATE
  1097. carla-jackbridge
  1098. carla-lilv
  1099. carla-water-files
  1100. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  1101. PkgConfig::FLUIDSYNTH
  1102. PkgConfig::X11
  1103. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  1104. ${CARLA_PTHREADS}
  1105. PUBLIC
  1106. $<$<BOOL:${WIN32}>:winmm>
  1107. )
  1108. target_sources(carla-utils
  1109. PRIVATE
  1110. ../source/backend/utils/CachedPlugins.cpp
  1111. ../source/backend/utils/CarlaUtils.cpp
  1112. ../source/backend/utils/Information.cpp
  1113. ../source/backend/utils/JUCE.cpp
  1114. ../source/backend/utils/PipeClient.cpp
  1115. ../source/backend/utils/PluginDiscovery.cpp
  1116. ../source/backend/utils/System.cpp
  1117. ../source/backend/utils/Windows.cpp
  1118. PUBLIC
  1119. ${carla-utils-public-headers}
  1120. )
  1121. install(TARGETS carla-utils
  1122. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1123. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1124. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  1125. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1126. )
  1127. if(${CARLA_BUILD_FRAMEWORKS})
  1128. install(TARGETS
  1129. carla-bridge-lv2-gtk2
  1130. carla-bridge-lv2-gtk3
  1131. carla-bridge-native
  1132. carla-discovery-native
  1133. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A)
  1134. install(CODE
  1135. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1136. Versions/A/carla-bridge-lv2-gtk2
  1137. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk2)")
  1138. install(CODE
  1139. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1140. Versions/A/carla-bridge-lv2-gtk3
  1141. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk3)")
  1142. install(CODE
  1143. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1144. Versions/A/carla-bridge-native
  1145. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-native)")
  1146. install(CODE
  1147. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1148. Versions/A/carla-discovery-native
  1149. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-discovery-native)")
  1150. endif()
  1151. #######################################################################################################################
  1152. if(APPLE)
  1153. set_source_files_properties(
  1154. ../source/backend/CarlaStandalone.cpp
  1155. ../source/backend/engine/CarlaEngineNative.cpp
  1156. ../source/backend/plugin/CarlaPluginCLAP.cpp
  1157. ../source/backend/plugin/CarlaPluginVST2.cpp
  1158. ../source/backend/plugin/CarlaPluginVST3.cpp
  1159. ../source/backend/utils/CarlaUtils.cpp
  1160. ../source/backend/utils/Windows.cpp
  1161. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  1162. ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
  1163. ../source/discovery/carla-discovery.cpp
  1164. ../source/modules/water/water.cpp
  1165. ../source/modules/water/water.files.cpp
  1166. PROPERTIES COMPILE_FLAGS -ObjC++)
  1167. endif()
  1168. #######################################################################################################################
  1169. # install code headers
  1170. add_library(carla-headers-backend INTERFACE)
  1171. add_library(carla-headers-includes INTERFACE)
  1172. add_library(carla-headers-utils INTERFACE)
  1173. set_property(TARGET carla-headers-backend
  1174. PROPERTY PUBLIC_HEADER
  1175. ../source/backend/CarlaBackend.h
  1176. ../source/backend/CarlaHost.h
  1177. ../source/backend/CarlaUtils.h
  1178. ../source/backend/CarlaEngine.hpp
  1179. ../source/backend/CarlaPlugin.hpp
  1180. ../source/backend/CarlaPluginPtr.hpp
  1181. )
  1182. set_property(TARGET carla-headers-includes
  1183. PROPERTY PUBLIC_HEADER
  1184. ../source/includes/CarlaDefines.h
  1185. ../source/includes/CarlaMIDI.h
  1186. ../source/includes/CarlaNative.h
  1187. ../source/includes/CarlaNativePlugin.h
  1188. )
  1189. set_property(TARGET carla-headers-utils
  1190. PROPERTY PUBLIC_HEADER
  1191. ../source/utils/CarlaBackendUtils.hpp
  1192. ../source/utils/CarlaBase64Utils.hpp
  1193. ../source/utils/CarlaBinaryUtils.hpp
  1194. ../source/utils/CarlaBridgeDefines.hpp
  1195. ../source/utils/CarlaBridgeUtils.hpp
  1196. ../source/utils/CarlaMacUtils.hpp
  1197. ../source/utils/CarlaMathUtils.hpp
  1198. ../source/utils/CarlaMutex.hpp
  1199. ../source/utils/CarlaRingBuffer.hpp
  1200. ../source/utils/CarlaProcessUtils.hpp
  1201. ../source/utils/CarlaRunner.hpp
  1202. ../source/utils/CarlaScopeUtils.hpp
  1203. ../source/utils/CarlaSemUtils.hpp
  1204. ../source/utils/CarlaSha1Utils.hpp
  1205. ../source/utils/CarlaShmUtils.hpp
  1206. ../source/utils/CarlaString.hpp
  1207. ../source/utils/CarlaThread.hpp
  1208. ../source/utils/CarlaTimeUtils.hpp
  1209. ../source/utils/CarlaUtils.hpp
  1210. )
  1211. install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
  1212. install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
  1213. install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
  1214. #######################################################################################################################
  1215. # pkg-config stuff
  1216. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  1217. configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
  1218. install(FILES
  1219. ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
  1220. DESTINATION
  1221. ${CMAKE_INSTALL_LIBDIR}/pkgconfig
  1222. )
  1223. endif()
  1224. #######################################################################################################################