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.

1600 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/CarlaPluginJSFX.cpp
  653. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  654. ../source/backend/plugin/CarlaPluginLV2.cpp
  655. ../source/backend/plugin/CarlaPluginNative.cpp
  656. ../source/backend/plugin/CarlaPluginSFZero.cpp
  657. ../source/backend/plugin/CarlaPluginVST2.cpp
  658. ../source/backend/plugin/CarlaPluginVST3.cpp
  659. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  660. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  661. )
  662. #######################################################################################################################
  663. # carla bridge-lv2-gtk2
  664. add_executable(carla-bridge-lv2-gtk2)
  665. set_common_target_properties(carla-bridge-lv2-gtk2)
  666. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  667. install(TARGETS carla-bridge-lv2-gtk2
  668. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  669. )
  670. endif()
  671. target_compile_definitions(carla-bridge-lv2-gtk2
  672. PRIVATE
  673. BUILD_BRIDGE
  674. BUILD_BRIDGE_UI
  675. BRIDGE_GTK2
  676. )
  677. target_include_directories(carla-bridge-lv2-gtk2
  678. PRIVATE
  679. ../source/backend
  680. ../source/includes
  681. ../source/modules
  682. ../source/utils
  683. )
  684. target_link_libraries(carla-bridge-lv2-gtk2
  685. PRIVATE
  686. carla-lilv
  687. carla-water-files
  688. PUBLIC
  689. PkgConfig::X11
  690. ${CARLA_PTHREADS}
  691. )
  692. target_sources(carla-bridge-lv2-gtk2
  693. PRIVATE
  694. ../source/bridges-ui/CarlaBridgeFormat.cpp
  695. ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
  696. ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
  697. )
  698. #######################################################################################################################
  699. # carla bridge-lv2-gtk3
  700. add_executable(carla-bridge-lv2-gtk3)
  701. set_common_target_properties(carla-bridge-lv2-gtk3)
  702. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  703. install(TARGETS carla-bridge-lv2-gtk3
  704. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  705. )
  706. endif()
  707. target_compile_definitions(carla-bridge-lv2-gtk3
  708. PRIVATE
  709. BUILD_BRIDGE
  710. BUILD_BRIDGE_UI
  711. BRIDGE_GTK3
  712. )
  713. target_include_directories(carla-bridge-lv2-gtk3
  714. PRIVATE
  715. ../source/backend
  716. ../source/includes
  717. ../source/modules
  718. ../source/utils
  719. )
  720. target_link_libraries(carla-bridge-lv2-gtk3
  721. PRIVATE
  722. carla-lilv
  723. carla-water-files
  724. PUBLIC
  725. PkgConfig::X11
  726. ${CARLA_PTHREADS}
  727. )
  728. target_sources(carla-bridge-lv2-gtk3
  729. PRIVATE
  730. ../source/bridges-ui/CarlaBridgeFormat.cpp
  731. ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
  732. ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
  733. )
  734. #######################################################################################################################
  735. # carla discovery-native
  736. add_executable(carla-discovery-native)
  737. set_common_target_properties(carla-discovery-native)
  738. if(NOT ${CARLA_BUILD_FRAMEWORKS})
  739. install(TARGETS carla-discovery-native
  740. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  741. )
  742. endif()
  743. target_include_directories(carla-discovery-native
  744. PRIVATE
  745. ../source/backend
  746. ../source/includes
  747. ../source/modules
  748. ../source/utils
  749. )
  750. target_link_libraries(carla-discovery-native
  751. PRIVATE
  752. carla-lilv
  753. carla-water-files
  754. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  755. PUBLIC
  756. PkgConfig::FLUIDSYNTH
  757. ${CARLA_PTHREADS}
  758. )
  759. target_sources(carla-discovery-native
  760. PRIVATE
  761. ../source/discovery/carla-discovery.cpp
  762. )
  763. #######################################################################################################################
  764. # carla host-plugin
  765. add_library(carla-host-plugin ${CARLA_LIB_TYPE})
  766. add_library(carla::host-plugin ALIAS carla-host-plugin)
  767. set_common_target_properties(carla-host-plugin)
  768. if(${CARLA_BUILD_FRAMEWORKS})
  769. set(carla-host-plugin-public-headers
  770. ../source/backend/CarlaBackend.h
  771. ../source/backend/CarlaHost.h
  772. ../source/backend/CarlaUtils.h
  773. )
  774. set_target_properties(carla-host-plugin
  775. PROPERTIES
  776. FRAMEWORK TRUE
  777. FRAMEWORK_VERSION A
  778. OUTPUT_NAME carla-host-plugin
  779. PUBLIC_HEADER "${carla-host-plugin-public-headers}"
  780. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  781. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.host-plugin"
  782. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  783. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  784. )
  785. else()
  786. set_target_properties(carla-host-plugin
  787. PROPERTIES
  788. OUTPUT_NAME carla_host-plugin
  789. IMPORT_PREFIX lib
  790. PREFIX lib
  791. )
  792. endif()
  793. target_compile_definitions(carla-host-plugin
  794. PRIVATE
  795. CARLA_PLUGIN_BUILD
  796. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  797. )
  798. # FIXME
  799. # target_compile_options(carla-host-plugin
  800. # PRIVATE
  801. # $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  802. # )
  803. target_include_directories(carla-host-plugin
  804. PRIVATE
  805. ../source
  806. ../source/modules
  807. PUBLIC
  808. ../source/backend
  809. ../source/includes
  810. ../source/utils
  811. )
  812. target_link_libraries(carla-host-plugin
  813. PRIVATE
  814. carla-jackbridge
  815. carla-lilv
  816. carla-native-plugins
  817. carla-rtmempool
  818. carla-sfzero
  819. carla-water
  820. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  821. carla-zita-resampler
  822. PUBLIC
  823. PkgConfig::FLUIDSYNTH
  824. PkgConfig::LIBLO
  825. PkgConfig::LIBMAGIC
  826. PkgConfig::X11
  827. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  828. ${CARLA_PTHREADS}
  829. )
  830. target_sources(carla-host-plugin
  831. PRIVATE
  832. ../source/backend/engine/CarlaEngine.cpp
  833. ../source/backend/engine/CarlaEngineClient.cpp
  834. ../source/backend/engine/CarlaEngineData.cpp
  835. ../source/backend/engine/CarlaEngineGraph.cpp
  836. ../source/backend/engine/CarlaEngineInternal.cpp
  837. ../source/backend/engine/CarlaEngineNative.cpp
  838. ../source/backend/engine/CarlaEngineOsc.cpp
  839. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  840. ../source/backend/engine/CarlaEngineOscSend.cpp
  841. ../source/backend/engine/CarlaEnginePorts.cpp
  842. ../source/backend/engine/CarlaEngineRunner.cpp
  843. ../source/backend/plugin/CarlaPlugin.cpp
  844. ../source/backend/plugin/CarlaPluginBridge.cpp
  845. ../source/backend/plugin/CarlaPluginInternal.cpp
  846. ../source/backend/plugin/CarlaPluginAU.cpp
  847. ../source/backend/plugin/CarlaPluginCLAP.cpp
  848. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  849. ../source/backend/plugin/CarlaPluginJSFX.cpp
  850. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  851. ../source/backend/plugin/CarlaPluginLV2.cpp
  852. ../source/backend/plugin/CarlaPluginNative.cpp
  853. ../source/backend/plugin/CarlaPluginSFZero.cpp
  854. ../source/backend/plugin/CarlaPluginVST2.cpp
  855. ../source/backend/plugin/CarlaPluginVST3.cpp
  856. ../source/plugin/carla-host-plugin.cpp
  857. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  858. PUBLIC
  859. ${carla-host-plugin-public-headers}
  860. )
  861. install(TARGETS carla-host-plugin
  862. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  863. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  864. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  865. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  866. )
  867. if(${CARLA_BUILD_FRAMEWORKS})
  868. install(FILES
  869. ../source/includes/CarlaDefines.h
  870. ../source/includes/CarlaNative.h
  871. ../source/includes/CarlaNativePlugin.h
  872. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
  873. endif()
  874. #######################################################################################################################
  875. # carla native-plugin
  876. add_library(carla-native-plugin ${CARLA_LIB_TYPE})
  877. add_library(carla::native-plugin ALIAS carla-native-plugin)
  878. set_common_target_properties(carla-native-plugin)
  879. if(${CARLA_BUILD_FRAMEWORKS})
  880. set(carla-native-plugin-public-headers
  881. ../source/backend/CarlaBackend.h
  882. ../source/backend/CarlaHost.h
  883. ../source/backend/CarlaUtils.h
  884. )
  885. set_target_properties(carla-native-plugin
  886. PROPERTIES
  887. FRAMEWORK TRUE
  888. FRAMEWORK_VERSION A
  889. OUTPUT_NAME carla-native-plugin
  890. PUBLIC_HEADER "${carla-native-plugin-public-headers}"
  891. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  892. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.native-plugin"
  893. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  894. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  895. )
  896. else()
  897. set_target_properties(carla-native-plugin
  898. PROPERTIES
  899. OUTPUT_NAME carla_native-plugin
  900. IMPORT_PREFIX lib
  901. PREFIX lib
  902. )
  903. endif()
  904. target_compile_definitions(carla-native-plugin
  905. PRIVATE
  906. CARLA_PLUGIN_BUILD
  907. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  908. )
  909. # FIXME
  910. # target_compile_options(carla-native-plugin
  911. # PRIVATE
  912. # $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  913. # )
  914. target_include_directories(carla-native-plugin
  915. PRIVATE
  916. ../source
  917. ../source/modules
  918. PUBLIC
  919. ../source/backend
  920. ../source/includes
  921. ../source/utils
  922. )
  923. if(APPLE)
  924. target_link_options(carla-native-plugin
  925. PRIVATE
  926. -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
  927. -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
  928. -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
  929. -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
  930. -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
  931. -Wl,-exported_symbol,_carla_get_native_patchbay_cv8_plugin
  932. -Wl,-exported_symbol,_carla_get_native_patchbay_cv32_plugin
  933. -Wl,-exported_symbol,_carla_get_native_patchbay_obs_plugin
  934. -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
  935. -Wl,-exported_symbol,_carla_host_handle_free
  936. -Wl,-exported_symbol,_carla_get_native_plugin_engine
  937. -Wl,-exported_symbol,_carla_get_complete_license_text
  938. -Wl,-exported_symbol,_carla_get_supported_file_extensions
  939. -Wl,-exported_symbol,_carla_get_supported_features
  940. -Wl,-exported_symbol,_carla_get_library_filename
  941. -Wl,-exported_symbol,_carla_get_library_folder
  942. )
  943. elseif(EMSCRIPTEN)
  944. target_link_options(carla-native-plugin
  945. PRIVATE
  946. -sSIDE_MODULE=2
  947. -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_supported_file_extensions','carla_get_supported_features','carla_get_library_filename','carla_get_library_folder']"
  948. )
  949. elseif(MSVC)
  950. target_link_options(carla-native-plugin
  951. PRIVATE
  952. /DEF:${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
  953. )
  954. elseif(WIN32)
  955. target_link_options(carla-native-plugin
  956. PRIVATE
  957. ${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
  958. )
  959. else()
  960. target_link_options(carla-native-plugin
  961. PRIVATE
  962. -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.version
  963. )
  964. endif()
  965. target_link_libraries(carla-native-plugin
  966. PRIVATE
  967. carla-jackbridge
  968. carla-lilv
  969. carla-native-plugins
  970. carla-rtmempool
  971. carla-sfzero
  972. carla-water
  973. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  974. carla-zita-resampler
  975. PUBLIC
  976. PkgConfig::FLUIDSYNTH
  977. PkgConfig::LIBLO
  978. PkgConfig::LIBMAGIC
  979. PkgConfig::X11
  980. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  981. ${CARLA_PTHREADS}
  982. )
  983. target_sources(carla-native-plugin
  984. PRIVATE
  985. ../source/backend/engine/CarlaEngine.cpp
  986. ../source/backend/engine/CarlaEngineClient.cpp
  987. ../source/backend/engine/CarlaEngineData.cpp
  988. ../source/backend/engine/CarlaEngineGraph.cpp
  989. ../source/backend/engine/CarlaEngineInternal.cpp
  990. ../source/backend/engine/CarlaEngineNative.cpp
  991. ../source/backend/engine/CarlaEngineOsc.cpp
  992. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  993. ../source/backend/engine/CarlaEngineOscSend.cpp
  994. ../source/backend/engine/CarlaEnginePorts.cpp
  995. ../source/backend/engine/CarlaEngineRunner.cpp
  996. ../source/backend/plugin/CarlaPlugin.cpp
  997. ../source/backend/plugin/CarlaPluginBridge.cpp
  998. ../source/backend/plugin/CarlaPluginInternal.cpp
  999. ../source/backend/plugin/CarlaPluginAU.cpp
  1000. ../source/backend/plugin/CarlaPluginCLAP.cpp
  1001. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  1002. ../source/backend/plugin/CarlaPluginJSFX.cpp
  1003. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  1004. ../source/backend/plugin/CarlaPluginLV2.cpp
  1005. ../source/backend/plugin/CarlaPluginNative.cpp
  1006. ../source/backend/plugin/CarlaPluginSFZero.cpp
  1007. ../source/backend/plugin/CarlaPluginVST2.cpp
  1008. ../source/backend/plugin/CarlaPluginVST3.cpp
  1009. ../source/plugin/carla-native-plugin.cpp
  1010. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  1011. PUBLIC
  1012. ${carla-native-plugin-public-headers}
  1013. )
  1014. install(TARGETS carla-native-plugin
  1015. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1016. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1017. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1018. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  1019. )
  1020. if(${CARLA_BUILD_FRAMEWORKS})
  1021. install(FILES
  1022. ../source/includes/CarlaDefines.h
  1023. ../source/includes/CarlaNative.h
  1024. ../source/includes/CarlaNativePlugin.h
  1025. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
  1026. endif()
  1027. #######################################################################################################################
  1028. # carla standalone
  1029. add_library(carla-standalone ${CARLA_LIB_TYPE})
  1030. add_library(carla::standalone ALIAS carla-standalone)
  1031. set_common_target_properties(carla-standalone)
  1032. if(${CARLA_BUILD_FRAMEWORKS})
  1033. set(carla-standalone-public-headers
  1034. ../source/backend/CarlaBackend.h
  1035. ../source/backend/CarlaHost.h
  1036. ../source/backend/CarlaEngine.hpp
  1037. ../source/backend/CarlaPlugin.hpp
  1038. ../source/backend/CarlaPluginPtr.hpp
  1039. )
  1040. set_target_properties(carla-standalone
  1041. PROPERTIES
  1042. FRAMEWORK TRUE
  1043. FRAMEWORK_VERSION A
  1044. OUTPUT_NAME carla-standalone
  1045. PUBLIC_HEADER "${carla-standalone-public-headers}"
  1046. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  1047. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.standalone"
  1048. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  1049. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  1050. )
  1051. else()
  1052. set_target_properties(carla-standalone
  1053. PROPERTIES
  1054. OUTPUT_NAME carla_standalone2
  1055. IMPORT_PREFIX lib
  1056. PREFIX lib
  1057. )
  1058. endif()
  1059. target_compile_definitions(carla-standalone
  1060. PRIVATE
  1061. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  1062. )
  1063. # FIXME
  1064. target_compile_options(carla-standalone
  1065. PRIVATE
  1066. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  1067. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  1068. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  1069. $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
  1070. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  1071. )
  1072. target_include_directories(carla-standalone
  1073. PRIVATE
  1074. ../source
  1075. ../source/modules
  1076. PUBLIC
  1077. ../source/backend
  1078. ../source/includes
  1079. ../source/utils
  1080. )
  1081. target_link_libraries(carla-standalone
  1082. PRIVATE
  1083. carla-jackbridge
  1084. carla-lilv
  1085. carla-native-plugins
  1086. carla-rtmempool
  1087. carla-sfzero
  1088. carla-water
  1089. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  1090. carla-zita-resampler
  1091. PUBLIC
  1092. PkgConfig::FLUIDSYNTH
  1093. PkgConfig::LIBLO
  1094. PkgConfig::LIBMAGIC
  1095. PkgConfig::X11
  1096. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  1097. ${CARLA_PTHREADS}
  1098. )
  1099. target_sources(carla-standalone
  1100. PRIVATE
  1101. ../source/backend/CarlaStandalone.cpp
  1102. ../source/backend/CarlaStandaloneNSM.cpp
  1103. ../source/backend/engine/CarlaEngine.cpp
  1104. ../source/backend/engine/CarlaEngineClient.cpp
  1105. ../source/backend/engine/CarlaEngineDummy.cpp
  1106. ../source/backend/engine/CarlaEngineData.cpp
  1107. ../source/backend/engine/CarlaEngineGraph.cpp
  1108. ../source/backend/engine/CarlaEngineInternal.cpp
  1109. ../source/backend/engine/CarlaEngineNative.cpp
  1110. ../source/backend/engine/CarlaEngineOsc.cpp
  1111. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  1112. ../source/backend/engine/CarlaEngineOscSend.cpp
  1113. ../source/backend/engine/CarlaEnginePorts.cpp
  1114. ../source/backend/engine/CarlaEngineRunner.cpp
  1115. ../source/backend/plugin/CarlaPlugin.cpp
  1116. ../source/backend/plugin/CarlaPluginBridge.cpp
  1117. ../source/backend/plugin/CarlaPluginInternal.cpp
  1118. ../source/backend/plugin/CarlaPluginAU.cpp
  1119. ../source/backend/plugin/CarlaPluginCLAP.cpp
  1120. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  1121. ../source/backend/plugin/CarlaPluginJSFX.cpp
  1122. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  1123. ../source/backend/plugin/CarlaPluginLV2.cpp
  1124. ../source/backend/plugin/CarlaPluginNative.cpp
  1125. ../source/backend/plugin/CarlaPluginSFZero.cpp
  1126. ../source/backend/plugin/CarlaPluginVST2.cpp
  1127. ../source/backend/plugin/CarlaPluginVST3.cpp
  1128. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  1129. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  1130. PUBLIC
  1131. ${carla-standalone-public-headers}
  1132. )
  1133. install(TARGETS carla-standalone
  1134. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1135. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1136. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1137. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  1138. )
  1139. if(${CARLA_BUILD_FRAMEWORKS})
  1140. install(TARGETS
  1141. carla-bridge-lv2-gtk2
  1142. carla-bridge-lv2-gtk3
  1143. carla-bridge-native
  1144. carla-discovery-native
  1145. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A)
  1146. install(FILES
  1147. ../source/includes/CarlaDefines.h
  1148. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
  1149. install(FILES
  1150. ../source/utils/CarlaUtils.hpp
  1151. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/utils)
  1152. install(CODE
  1153. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1154. Versions/Current/carla-bridge-lv2-gtk2
  1155. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk2)")
  1156. install(CODE
  1157. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1158. Versions/Current/carla-bridge-lv2-gtk3
  1159. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk3)")
  1160. install(CODE
  1161. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1162. Versions/Current/carla-bridge-native
  1163. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-native)")
  1164. install(CODE
  1165. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1166. Versions/Current/carla-discovery-native
  1167. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-discovery-native)")
  1168. endif()
  1169. #######################################################################################################################
  1170. # carla utils
  1171. add_library(carla-utils ${CARLA_LIB_TYPE})
  1172. add_library(carla::utils ALIAS carla-utils)
  1173. set_common_target_properties(carla-utils)
  1174. if(${CARLA_BUILD_FRAMEWORKS})
  1175. set(carla-utils-public-headers
  1176. ../source/backend/CarlaBackend.h
  1177. ../source/backend/CarlaUtils.h
  1178. )
  1179. set_target_properties(carla-utils
  1180. PROPERTIES
  1181. FRAMEWORK TRUE
  1182. FRAMEWORK_VERSION A
  1183. OUTPUT_NAME carla-utils
  1184. PUBLIC_HEADER "${carla-utils-public-headers}"
  1185. MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
  1186. MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.utils"
  1187. MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
  1188. MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
  1189. )
  1190. else()
  1191. set_target_properties(carla-utils
  1192. PROPERTIES
  1193. OUTPUT_NAME carla_utils
  1194. IMPORT_PREFIX lib
  1195. PREFIX lib
  1196. )
  1197. endif()
  1198. target_include_directories(carla-utils
  1199. PRIVATE
  1200. ../source
  1201. ../source/modules
  1202. PUBLIC
  1203. ../source/backend
  1204. ../source/includes
  1205. ../source/utils
  1206. )
  1207. target_link_libraries(carla-utils
  1208. PRIVATE
  1209. carla-jackbridge
  1210. carla-lilv
  1211. carla-water-files
  1212. $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
  1213. PUBLIC
  1214. PkgConfig::FLUIDSYNTH
  1215. PkgConfig::LIBMAGIC
  1216. PkgConfig::X11
  1217. ${CARLA_PTHREADS}
  1218. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
  1219. $<$<BOOL:${WIN32}>:winmm>
  1220. )
  1221. target_sources(carla-utils
  1222. PRIVATE
  1223. ../source/backend/utils/CachedPlugins.cpp
  1224. ../source/backend/utils/CarlaUtils.cpp
  1225. ../source/backend/utils/Information.cpp
  1226. ../source/backend/utils/PipeClient.cpp
  1227. ../source/backend/utils/PluginDiscovery.cpp
  1228. ../source/backend/utils/System.cpp
  1229. ../source/backend/utils/Windows.cpp
  1230. PUBLIC
  1231. ${carla-utils-public-headers}
  1232. )
  1233. install(TARGETS carla-utils
  1234. ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
  1235. LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
  1236. RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
  1237. FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
  1238. )
  1239. if(${CARLA_BUILD_FRAMEWORKS})
  1240. install(TARGETS
  1241. carla-bridge-lv2-gtk2
  1242. carla-bridge-lv2-gtk3
  1243. carla-bridge-native
  1244. carla-discovery-native
  1245. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A)
  1246. install(FILES
  1247. ../source/includes/CarlaDefines.h
  1248. ../source/includes/CarlaMIDI.h
  1249. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/includes)
  1250. install(FILES
  1251. ../source/utils/CarlaBackendUtils.hpp
  1252. ../source/utils/CarlaBase64Utils.hpp
  1253. ../source/utils/CarlaBinaryUtils.hpp
  1254. ../source/utils/CarlaBridgeDefines.hpp
  1255. ../source/utils/CarlaBridgeUtils.hpp
  1256. ../source/utils/CarlaMacUtils.hpp
  1257. ../source/utils/CarlaMathUtils.hpp
  1258. ../source/utils/CarlaMemUtils.hpp
  1259. ../source/utils/CarlaMutex.hpp
  1260. ../source/utils/CarlaRingBuffer.hpp
  1261. ../source/utils/CarlaProcessUtils.hpp
  1262. ../source/utils/CarlaRunner.hpp
  1263. ../source/utils/CarlaScopeUtils.hpp
  1264. ../source/utils/CarlaSemUtils.hpp
  1265. ../source/utils/CarlaSha1Utils.hpp
  1266. ../source/utils/CarlaShmUtils.hpp
  1267. ../source/utils/CarlaString.hpp
  1268. ../source/utils/CarlaThread.hpp
  1269. ../source/utils/CarlaTimeUtils.hpp
  1270. ../source/utils/CarlaUtils.hpp
  1271. DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/utils)
  1272. install(CODE
  1273. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1274. Versions/Current/carla-bridge-lv2-gtk2
  1275. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk2)")
  1276. install(CODE
  1277. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1278. Versions/Current/carla-bridge-lv2-gtk3
  1279. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk3)")
  1280. install(CODE
  1281. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1282. Versions/Current/carla-bridge-native
  1283. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-native)")
  1284. install(CODE
  1285. "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1286. Versions/Current/carla-discovery-native
  1287. $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-discovery-native)")
  1288. endif()
  1289. #######################################################################################################################
  1290. if(APPLE)
  1291. set_source_files_properties(
  1292. ../source/backend/CarlaStandalone.cpp
  1293. ../source/backend/engine/CarlaEngineNative.cpp
  1294. ../source/backend/plugin/CarlaPluginAU.cpp
  1295. ../source/backend/plugin/CarlaPluginCLAP.cpp
  1296. ../source/backend/plugin/CarlaPluginVST2.cpp
  1297. ../source/backend/plugin/CarlaPluginVST3.cpp
  1298. ../source/backend/utils/CarlaUtils.cpp
  1299. ../source/backend/utils/Windows.cpp
  1300. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  1301. ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
  1302. ../source/discovery/carla-discovery.cpp
  1303. ../source/modules/water/water.cpp
  1304. ../source/modules/water/water.files.cpp
  1305. PROPERTIES COMPILE_FLAGS -ObjC++)
  1306. endif()
  1307. #######################################################################################################################
  1308. # install code headers
  1309. add_library(carla-headers-backend INTERFACE)
  1310. add_library(carla-headers-includes INTERFACE)
  1311. add_library(carla-headers-utils INTERFACE)
  1312. set_property(TARGET carla-headers-backend
  1313. PROPERTY PUBLIC_HEADER
  1314. ../source/backend/CarlaBackend.h
  1315. ../source/backend/CarlaHost.h
  1316. ../source/backend/CarlaUtils.h
  1317. ../source/backend/CarlaEngine.hpp
  1318. ../source/backend/CarlaPlugin.hpp
  1319. ../source/backend/CarlaPluginPtr.hpp
  1320. )
  1321. set_property(TARGET carla-headers-includes
  1322. PROPERTY PUBLIC_HEADER
  1323. ../source/includes/CarlaDefines.h
  1324. ../source/includes/CarlaMIDI.h
  1325. ../source/includes/CarlaNative.h
  1326. ../source/includes/CarlaNativePlugin.h
  1327. )
  1328. set_property(TARGET carla-headers-utils
  1329. PROPERTY PUBLIC_HEADER
  1330. ../source/utils/CarlaBackendUtils.hpp
  1331. ../source/utils/CarlaBase64Utils.hpp
  1332. ../source/utils/CarlaBinaryUtils.hpp
  1333. ../source/utils/CarlaBridgeDefines.hpp
  1334. ../source/utils/CarlaBridgeUtils.hpp
  1335. ../source/utils/CarlaMacUtils.hpp
  1336. ../source/utils/CarlaMathUtils.hpp
  1337. ../source/utils/CarlaMemUtils.hpp
  1338. ../source/utils/CarlaMutex.hpp
  1339. ../source/utils/CarlaRingBuffer.hpp
  1340. ../source/utils/CarlaProcessUtils.hpp
  1341. ../source/utils/CarlaRunner.hpp
  1342. ../source/utils/CarlaScopeUtils.hpp
  1343. ../source/utils/CarlaSemUtils.hpp
  1344. ../source/utils/CarlaSha1Utils.hpp
  1345. ../source/utils/CarlaShmUtils.hpp
  1346. ../source/utils/CarlaString.hpp
  1347. ../source/utils/CarlaThread.hpp
  1348. ../source/utils/CarlaTimeUtils.hpp
  1349. ../source/utils/CarlaUtils.hpp
  1350. )
  1351. install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
  1352. install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
  1353. install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
  1354. #######################################################################################################################
  1355. # pkg-config stuff
  1356. if(NOT ${CARLA_BUILD_FRAMEWORKS} AND NOT MSVC)
  1357. configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
  1358. configure_file(carla-standalone.pc.in carla-standalone.pc @ONLY)
  1359. configure_file(carla-native-plugin.pc.in carla-native-plugin.pc @ONLY)
  1360. configure_file(carla-host-plugin.pc.in carla-host-plugin.pc @ONLY)
  1361. install(FILES
  1362. ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
  1363. ${CMAKE_CURRENT_BINARY_DIR}/carla-standalone.pc
  1364. ${CMAKE_CURRENT_BINARY_DIR}/carla-native-plugin.pc
  1365. ${CMAKE_CURRENT_BINARY_DIR}/carla-host-plugin.pc
  1366. DESTINATION
  1367. ${CMAKE_INSTALL_LIBDIR}/pkgconfig
  1368. )
  1369. endif()
  1370. #######################################################################################################################