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.

1605 lines
48KB

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