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.

1314 lines
39KB

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