Update CI setup
[carla.git] / cmake / CMakeLists.txt
blob896789bf415f1957974748035660237925e133cc
1 cmake_minimum_required(VERSION 3.15)
3 # adjust for last compatible macOS version
4 if(APPLE)
5   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Minimum macOS deployment version")
6   set(CARLA_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
7   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
8   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
9 endif()
11 project(carla)
13 set(PROJECT_VERSION 2.6.0-alpha1)
14 set(PROJECT_SHORT_VERSION 2.5.91)
16 set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
17 set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
18 set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
19 set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
21 set(CMAKE_C_STANDARD 11)
22 set(CMAKE_CXX_STANDARD 11)
24 set(CMAKE_C_VISIBILITY_PRESET hidden)
25 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
26 set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
28 set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
30 #######################################################################################################################
31 # fix compat with cmake < 3.26
33 if(CMAKE_VERSION VERSION_LESS 3.26)
34   if(MSVC)
35     set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
36   else()
37     set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
38   endif()
39   mark_as_advanced(CMAKE_C_COMPILER_FRONTEND_VARIANT)
40 endif()
42 #######################################################################################################################
43 # build options
45 if(MSVC)
46   set(CARLA_USE_JACK_DEFAULT FALSE)
47   set(CARLA_USE_OSC_DEFAULT FALSE)
48 else()
49   set(CARLA_USE_JACK_DEFAULT TRUE)
50   set(CARLA_USE_OSC_DEFAULT TRUE)
51 endif()
53 set(CARLA_BUILD_FRAMEWORKS FALSE CACHE BOOL "Build libraries as macOS frameworks")
54 set(CARLA_BUILD_STATIC FALSE CACHE BOOL "Build static libraries")
55 set(CARLA_ENABLE_JSFX TRUE CACHE BOOL "Enable JSFX")
56 set(CARLA_USE_JACK ${CARLA_USE_JACK_DEFAULT} CACHE BOOL "Enable JACK")
57 set(CARLA_USE_OSC ${CARLA_USE_OSC_DEFAULT} CACHE BOOL "Enable OSC")
59 if(${CARLA_BUILD_FRAMEWORKS} AND NOT APPLE)
60   set(CARLA_BUILD_FRAMEWORKS FALSE)
61   mark_as_advanced(CARLA_BUILD_FRAMEWORKS)
62 endif()
64 if(${CARLA_BUILD_STATIC})
65   set(CARLA_LIB_TYPE STATIC)
66 else()
67   set(CARLA_LIB_TYPE SHARED)
68 endif()
70 if(${CARLA_BUILD_FRAMEWORKS})
71   execute_process(COMMAND date -u +%y%m%d%H%M%S OUTPUT_VARIABLE CARLA_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
72 endif()
74 #######################################################################################################################
75 # required dependencies
77 include(GNUInstallDirs)
79 find_package(Threads REQUIRED)
81 if(NOT (APPLE OR HAIKU OR WIN32))
82   set(CARLA_LIBDL dl)
83   set(CARLA_LIBM m)
84   set(CARLA_LIBRT rt)
85 endif()
87 #######################################################################################################################
88 # optional dependencies
90 find_package(PkgConfig QUIET)
92 # homebrew does not support universal binaries, disable external deps if it is in use
93 if(APPLE)
94   find_program(HOMEBREW brew)
95   if(HOMEBREW)
96     set(PKGCONFIG_FOUND FALSE)
97     mark_as_advanced(PKGCONFIG_FOUND)
98   endif()
99 endif()
101 if(PKGCONFIG_FOUND)
102   pkg_check_modules(FLUIDSYNTH IMPORTED_TARGET fluidsynth)
103   pkg_check_modules(SNDFILE IMPORTED_TARGET sndfile)
104 else()
105   set(FLUIDSYNTH_FOUND FALSE)
106   set(SNDFILE_FOUND FALSE)
107 endif()
109 if(PKGCONFIG_FOUND AND CARLA_USE_OSC)
110   pkg_check_modules(LIBLO IMPORTED_TARGET liblo)
111 else()
112   set(LIBLO_FOUND FALSE)
113 endif()
115 if(PKGCONFIG_FOUND AND NOT WIN32)
116   pkg_check_modules(LIBMAGIC IMPORTED_TARGET libmagic)
117 else()
118   set(LIBMAGIC_FOUND FALSE)
119 endif()
121 if(PKGCONFIG_FOUND AND NOT (APPLE OR WIN32))
122   pkg_check_modules(X11 IMPORTED_TARGET x11)
123 else()
124   set(X11_FOUND FALSE)
125 endif()
127 add_library(carla-none INTERFACE)
129 if(NOT FLUIDSYNTH_FOUND)
130   add_library(PkgConfig::FLUIDSYNTH ALIAS carla-none)
131 endif()
133 if(NOT LIBLO_FOUND)
134   add_library(PkgConfig::LIBLO ALIAS carla-none)
135 endif()
137 if(NOT LIBMAGIC_FOUND)
138   add_library(PkgConfig::LIBMAGIC ALIAS carla-none)
139 endif()
141 if(NOT SNDFILE_FOUND)
142   add_library(PkgConfig::SNDFILE ALIAS carla-none)
143 endif()
145 if(NOT X11_FOUND)
146   add_library(PkgConfig::X11 ALIAS carla-none)
147 endif()
149 # TODO
150 set(PYQT_FOUND FALSE)
152 #######################################################################################################################
153 # utilities
155 if(WIN32)
156   set(CARLA_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
157   set(CARLA_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
158 else()
159   set(CARLA_INSTALL_BINDIR ${CMAKE_INSTALL_LIBDIR}/carla)
160   set(CARLA_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}/carla)
161 endif()
162 mark_as_advanced(CARLA_INSTALL_LIBDIR)
164 function(set_common_target_properties TARGET)
165   target_compile_definitions(${TARGET}
166     PRIVATE
167       BUILDING_CARLA
168       $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
169     PUBLIC
170       $<$<BOOL:${CARLA_ENABLE_JSFX}>:HAVE_YSFX>
171       $<$<BOOL:${CARLA_USE_JACK}>:HAVE_JACK>
172       $<$<BOOL:${FLUIDSYNTH_FOUND}>:HAVE_FLUIDSYNTH>
173       $<$<BOOL:${LIBLO_FOUND}>:HAVE_LIBLO>
174       $<$<BOOL:${LIBMAGIC_FOUND}>:HAVE_LIBMAGIC>
175       $<$<BOOL:${PYQT_FOUND}>:HAVE_PYQT>
176       $<$<BOOL:${SNDFILE_FOUND}>:HAVE_SNDFILE>
177       $<$<BOOL:${X11_FOUND}>:HAVE_X11>
178   )
180   target_compile_options(${TARGET}
181     PRIVATE
182       $<$<BOOL:${MSVC}>:/wd4244>
183       $<$<BOOL:${MSVC}>:/wd4267>
184       $<$<BOOL:${MSVC}>:/wd4273>
185   )
187   target_link_options(${TARGET}
188     PRIVATE
189       $<$<C_COMPILER_ID:GNU>:-Wl,--no-undefined>
190   )
192   set_property(TARGET ${TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)
194   if(APPLE)
195     set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES arm64)
196     set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES x86_64)
197   endif()
198 endfunction()
200 #######################################################################################################################
201 # setup pthreads for msvc
203 if(MSVC)
204   include(FetchContent)
205   FetchContent_Declare(pthreads4w
206     GIT_REPOSITORY https://git.code.sf.net/p/pthreads4w/code
207     GIT_TAG f12b445b336ee0117b43fca1d4b9f22c9af82c36
208   )
209   FetchContent_MakeAvailable(pthreads4w)
211   add_library(pthreads4w STATIC)
212   add_library(carla::pthreads4w ALIAS pthreads4w)
214   target_sources(pthreads4w PRIVATE ${pthreads4w_SOURCE_DIR}/pthread.c)
215   target_compile_definitions(pthreads4w
216     PRIVATE
217       HAVE_CONFIG_H
218       HAVE_STDINT_H=1
219       _POSIX_C_SOURCE=200112L
220     PUBLIC
221       INCLUDE_NP
222       PTW32_DLLPORT
223       __PTW32_STATIC_LIB
224   )
226   target_include_directories(pthreads4w
227     PUBLIC
228       ${pthreads4w_SOURCE_DIR}
229   )
230   set(CARLA_PTHREADS carla::pthreads4w)
231 else()
232   set(CARLA_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
233 endif()
235 #######################################################################################################################
236 # audio_decoder
238 add_library(carla-audio-decoder STATIC)
239 add_library(carla::audio-decoder ALIAS carla-audio-decoder)
241 set_common_target_properties(carla-audio-decoder)
243 target_include_directories(carla-audio-decoder
244   PRIVATE
245     ../source/includes
246     ../source/modules
247     ../source/utils
250 target_link_libraries(carla-audio-decoder
251   PUBLIC
252     PkgConfig::SNDFILE
255 target_sources(carla-audio-decoder
256   PRIVATE
257     ../source/modules/audio_decoder/ad_dr_mp3.c
258     ../source/modules/audio_decoder/ad_ffmpeg.c
259     ../source/modules/audio_decoder/ad_minimp3.c
260     ../source/modules/audio_decoder/ad_plugin.c
261     ../source/modules/audio_decoder/ad_soundfile.c
264 #######################################################################################################################
265 # jackbridge
267 add_library(carla-jackbridge STATIC)
268 add_library(carla::jackbridge ALIAS carla-jackbridge)
270 set_common_target_properties(carla-jackbridge)
272 target_include_directories(carla-jackbridge
273   PRIVATE
274     ../source/includes
275     ../source/utils
278 target_link_libraries(carla-jackbridge
279   PUBLIC
280     ${CARLA_LIBDL}
281     ${CARLA_LIBRT}
284 target_sources(carla-jackbridge
285   PRIVATE
286     ../source/jackbridge/JackBridge1.cpp
287     ../source/jackbridge/JackBridge2.cpp
290 #######################################################################################################################
291 # lilv
293 # serd
294 add_library(carla-lilv_serd STATIC)
296 set_common_target_properties(carla-lilv_serd)
298 target_compile_options(carla-lilv_serd
299   PRIVATE
300     $<$<BOOL:${MSVC}>:/wd4005>
301     $<$<BOOL:${MSVC}>:/wd4090>
302     $<$<BOOL:${MSVC}>:/wd4133>
303     $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
304     $<$<C_COMPILER_ID:GNU>:-Wno-implicit-fallthrough>
307 target_include_directories(carla-lilv_serd
308   PRIVATE
309     ../source/includes
310     ../source/modules/lilv/config
311     ../source/modules/lilv/serd-0.24.0
314 target_sources(carla-lilv_serd
315   PRIVATE
316     ../source/modules/lilv/serd.c
319 # sord
320 add_library(carla-lilv_sord STATIC)
322 set_common_target_properties(carla-lilv_sord)
324 target_compile_options(carla-lilv_sord
325   PRIVATE
326     $<$<BOOL:${MSVC}>:/wd4005>
327     $<$<BOOL:${MSVC}>:/wd4090>
328     $<$<BOOL:${MSVC}>:/wd4133>
329     $<$<C_COMPILER_ID:GNU>:-Wno-maybe-uninitialized>
330     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
331     # workaround compiler bug, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
332     $<$<C_COMPILER_ID:GNU>:-fno-strict-aliasing>
335 target_include_directories(carla-lilv_sord
336   PRIVATE
337     ../source/includes
338     ../source/modules/lilv/config
339     ../source/modules/lilv/sord-0.16.0
340     ../source/modules/lilv/sord-0.16.0/src
343 target_link_libraries(carla-lilv_sord
344   PRIVATE
345     carla-lilv_serd
348 target_sources(carla-lilv_sord
349   PRIVATE
350     ../source/modules/lilv/sord.c
353 # sratom
354 add_library(carla-lilv_sratom STATIC)
356 set_common_target_properties(carla-lilv_sratom)
358 target_compile_options(carla-lilv_sratom
359   PRIVATE
360     $<$<BOOL:${MSVC}>:/wd4005>
361     $<$<BOOL:${MSVC}>:/wd4090>
362     $<$<BOOL:${MSVC}>:/wd4133>
365 target_include_directories(carla-lilv_sratom
366   PRIVATE
367     ../source/includes
368     ../source/modules/lilv/config
369     ../source/modules/lilv/sratom-0.6.0
372 target_link_libraries(carla-lilv_sratom
373   PRIVATE
374     carla-lilv_serd
377 target_sources(carla-lilv_sratom
378   PRIVATE
379     ../source/modules/lilv/sratom.c
382 # lilv
383 add_library(carla-lilv_lilv STATIC)
385 set_common_target_properties(carla-lilv_lilv)
387 target_compile_options(carla-lilv_lilv
388   PRIVATE
389     $<$<BOOL:${MSVC}>:/wd4005>
390     $<$<BOOL:${MSVC}>:/wd4090>
391     $<$<BOOL:${MSVC}>:/wd4133>
392     $<$<C_COMPILER_ID:AppleClang>:-Wno-incompatible-pointer-types-discards-qualifiers>
393     $<$<C_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
394     $<$<C_COMPILER_ID:GNU>:-Wno-discarded-qualifiers>
395     $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
396     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
399 target_include_directories(carla-lilv_lilv
400   PRIVATE
401     ../source/includes
402     ../source/modules/lilv/config
403     ../source/modules/lilv/lilv-0.24.0
404     ../source/modules/lilv/lilv-0.24.0/src
407 target_link_libraries(carla-lilv_lilv
408   PRIVATE
409     carla-lilv_serd
410     carla-lilv_sord
411     carla-lilv_sratom
414 target_sources(carla-lilv_lilv
415   PRIVATE
416     ../source/modules/lilv/lilv.c
419 # combined target
420 add_library(carla-lilv INTERFACE)
421 add_library(carla::lilv ALIAS carla-lilv)
423 target_link_libraries(carla-lilv
424   INTERFACE
425     carla-lilv_serd
426     carla-lilv_sord
427     carla-lilv_sratom
428     carla-lilv_lilv
429     ${CARLA_LIBDL}
430     ${CARLA_LIBM}
431     ${CARLA_LIBRT}
434 #######################################################################################################################
435 # native-plugins
437 add_library(carla-native-plugins STATIC)
438 add_library(carla::native-plugins ALIAS carla-native-plugins)
440 set_common_target_properties(carla-native-plugins)
442 target_include_directories(carla-native-plugins
443   PRIVATE
444     ../source/includes
445     ../source/modules
446     ../source/utils
449 target_link_libraries(carla-native-plugins
450   PUBLIC
451     ${CARLA_PTHREADS}
454 target_sources(carla-native-plugins
455   PRIVATE
456     ../source/native-plugins/_all.c
457     ../source/native-plugins/_data.cpp
458     ../source/native-plugins/audio-gain.c
459     ../source/native-plugins/bypass.c
460     ../source/native-plugins/cv-to-audio.c
461     ../source/native-plugins/lfo.c
462     ../source/native-plugins/midi-channel-filter.c
463     ../source/native-plugins/midi-channel-ab.c
464     ../source/native-plugins/midi-channelize.c
465     ../source/native-plugins/midi-gain.c
466     ../source/native-plugins/midi-join.c
467     ../source/native-plugins/midi-split.c
468     ../source/native-plugins/midi-to-cv.c
469     ../source/native-plugins/midi-through.c
470     ../source/native-plugins/midi-transpose.c
471     ../source/native-plugins/audio-file.cpp
472     ../source/native-plugins/midi-file.cpp
473     # these rely on PyQt
474     $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/bigmeter.cpp>
475     $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/midi-pattern.cpp>
476     $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/notes.cpp>
477     $<$<BOOL:${PYQT_FOUND}>:../source/native-plugins/xycontroller.cpp>
480 #######################################################################################################################
481 # rtmempool
483 add_library(carla-rtmempool STATIC)
484 add_library(carla::rtmempool ALIAS carla-rtmempool)
486 set_common_target_properties(carla-rtmempool)
488 target_include_directories(carla-rtmempool
489   PRIVATE
490     ../source/includes
491     ../source/utils
494 target_link_libraries(carla-rtmempool
495   PUBLIC
496     ${CARLA_LIBDL}
497     ${CARLA_LIBRT}
498     ${CARLA_PTHREADS}
501 target_sources(carla-rtmempool
502   PRIVATE
503     ../source/modules/rtmempool/rtmempool.c
506 #######################################################################################################################
507 # sfzero
509 add_library(carla-sfzero STATIC)
510 add_library(carla::sfzero ALIAS carla-sfzero)
512 set_common_target_properties(carla-sfzero)
514 target_include_directories(carla-sfzero
515   PRIVATE
516     ../source/includes
517     ../source/modules
518     ../source/utils
521 target_link_libraries(carla-sfzero
522   PRIVATE
523     carla-audio-decoder
524   PUBLIC
525     ${CARLA_PTHREADS}
528 target_sources(carla-sfzero
529   PRIVATE
530     ../source/modules/sfzero/SFZero.cpp
533 #######################################################################################################################
534 # water
536 add_library(carla-water STATIC)
537 add_library(carla::water ALIAS carla-water)
539 set_common_target_properties(carla-water)
541 target_compile_options(carla-water
542   PRIVATE
543     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
546 target_include_directories(carla-water
547   PRIVATE
548     ../source/includes
549     ../source/utils
552 target_link_libraries(carla-water
553   PUBLIC
554     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
555     $<$<BOOL:${WIN32}>:comdlg32>
556     $<$<BOOL:${WIN32}>:ole32>
557     $<$<BOOL:${WIN32}>:winmm>
558     ${CARLA_LIBDL}
559     ${CARLA_LIBRT}
560     ${CARLA_PTHREADS}
563 target_sources(carla-water
564   PRIVATE
565     ../source/modules/water/water.cpp
568 #######################################################################################################################
569 # water-files
571 add_library(carla-water-files STATIC)
572 add_library(carla::water-files ALIAS carla-water-files)
574 set_common_target_properties(carla-water-files)
576 target_compile_options(carla-water-files
577   PRIVATE
578     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
581 target_include_directories(carla-water-files
582   PRIVATE
583     ../source/includes
584     ../source/utils
587 target_link_libraries(carla-water-files
588   PUBLIC
589     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
590     $<$<BOOL:${WIN32}>:ole32>
591     $<$<BOOL:${WIN32}>:winmm>
592     ${CARLA_LIBDL}
595 target_sources(carla-water-files
596   PRIVATE
597     ../source/modules/water/water.files.cpp
600 #######################################################################################################################
601 # ysfx
603 if(${CARLA_ENABLE_JSFX})
605 add_library(carla-ysfx STATIC)
606 add_library(carla::ysfx ALIAS carla-ysfx)
608 set_common_target_properties(carla-ysfx)
610 # YSFX_FTS_LACKS_LFS_SUPPORT
612 target_compile_definitions(carla-ysfx
613   PRIVATE
614     EEL_TARGET_PORTABLE
615     EELSCRIPT_NO_NET
616     EELSCRIPT_NO_LICE
617     NSEEL_ATOF=ysfx_wdl_atof
618     WDL_FFT_REALSIZE=8
619     WDL_LINEPARSE_ATOF=ysfx_wdl_atof
620     WDL_WIN32_UTF8_NO_UI_IMPL
621     YSFX_API=
622     YSFX_NO_GFX
623     YSFX_NO_STANDARD_MUTEX
624     $<$<BOOL:${WIN32}>:NOMINMAX>
625     $<$<NOT:$<BOOL:${MINGW}>>:_FILE_OFFSET_BITS=64>
628 # NOTE ugly -U /U due to cmake not supporting `target_remove_definitions`
629 # see https://gitlab.kitware.com/cmake/cmake/-/issues/19796
631 target_compile_options(carla-ysfx
632   PRIVATE
633     $<$<BOOL:${MINGW}>:-UUNICODE>
634     $<$<BOOL:${MINGW}>:-U_UNICODE>
635     $<$<BOOL:${MSVC}>:/wd4018>
636     $<$<BOOL:${MSVC}>:/wd4297>
637     $<$<BOOL:${MSVC}>:/UUNICODE>
638     $<$<BOOL:${MSVC}>:/U_UNICODE>
639     $<$<C_COMPILER_ID:AppleClang>:-Wno-newline-eof>
640     $<$<C_COMPILER_ID:GNU>:-Wno-extra>
641     $<$<C_COMPILER_ID:GNU>:-Wno-ignored-attributes>
642     $<$<C_COMPILER_ID:GNU>:-Wno-unused-function>
643     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-fsigned-char>
644     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-sign-compare>
645     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
646     $<$<AND:$<COMPILE_LANGUAGE:C>,$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>>:-Wno-missing-field-initializers>
647     $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wno-deprecated-copy>
650 target_include_directories(carla-ysfx
651   PRIVATE
652     ../source/modules/ysfx/include
653     ../source/modules/ysfx/sources
654     ../source/modules/ysfx/thirdparty/dr_libs
655     ../source/modules/ysfx/thirdparty/stb
656     ../source/modules/ysfx/thirdparty/WDL/source
659 target_sources(carla-ysfx
660   PRIVATE
661     ../source/modules/ysfx/sources/ysfx.cpp
662     ../source/modules/ysfx/sources/ysfx_api_eel.cpp
663     ../source/modules/ysfx/sources/ysfx_api_file.cpp
664     ../source/modules/ysfx/sources/ysfx_api_gfx.cpp
665     ../source/modules/ysfx/sources/ysfx_api_reaper.cpp
666     ../source/modules/ysfx/sources/ysfx_audio_flac.cpp
667     ../source/modules/ysfx/sources/ysfx_audio_wav.cpp
668     ../source/modules/ysfx/sources/ysfx_config.cpp
669     ../source/modules/ysfx/sources/ysfx_eel_utils.cpp
670     ../source/modules/ysfx/sources/ysfx_midi.cpp
671     ../source/modules/ysfx/sources/ysfx_parse.cpp
672     ../source/modules/ysfx/sources/ysfx_reader.cpp
673     ../source/modules/ysfx/sources/ysfx_utils.cpp
674     ../source/modules/ysfx/sources/ysfx_utils_fts.cpp
675     ../source/modules/ysfx/sources/eel2-gas/sources/asm-nseel-x64-sse.S
676     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-caltab.c
677     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-cfunc.c
678     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-compiler.c
679     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-eval.c
680     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-lextab.c
681     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-ram.c
682     ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-yylex.c
683     ../source/modules/ysfx/thirdparty/WDL/source/WDL/fft.c
684     $<$<BOOL:${WIN32}>:../source/modules/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c>
687 endif(${CARLA_ENABLE_JSFX})
689 #######################################################################################################################
690 # zita-resampler
692 add_library(carla-zita-resampler STATIC)
693 add_library(carla::zita-resampler ALIAS carla-zita-resampler)
695 set_common_target_properties(carla-zita-resampler)
697 target_include_directories(carla-zita-resampler
698   PRIVATE
699     ../source/includes
702 target_link_libraries(carla-zita-resampler
703   PUBLIC
704     ${CARLA_PTHREADS}
707 target_sources(carla-zita-resampler
708   PRIVATE
709     ../source/modules/zita-resampler/cresampler.cc
710     ../source/modules/zita-resampler/resampler-table.cc
711     ../source/modules/zita-resampler/resampler.cc
712     ../source/modules/zita-resampler/vresampler.cc
715 #######################################################################################################################
716 # carla bridge-native
718 add_executable(carla-bridge-native)
720 set_common_target_properties(carla-bridge-native)
722 if(NOT ${CARLA_BUILD_FRAMEWORKS})
723   install(TARGETS carla-bridge-native
724     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
725   )
726 endif()
728 target_compile_definitions(carla-bridge-native
729   PRIVATE
730     BUILD_BRIDGE
731     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
734 # FIXME
735 target_compile_options(carla-bridge-native
736   PRIVATE
737     $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
738     $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
739     $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
740     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
743 target_include_directories(carla-bridge-native
744   PRIVATE
745     ../source
746     ../source/backend
747     ../source/backend/engine
748     ../source/backend/plugin
749     ../source/includes
750     ../source/modules
751     ../source/utils
754 target_link_libraries(carla-bridge-native
755   PRIVATE
756     carla-audio-decoder
757     carla-jackbridge
758     carla-lilv
759     carla-native-plugins
760     carla-rtmempool
761     carla-sfzero
762     carla-water
763     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
764     carla-zita-resampler
765   PUBLIC
766     PkgConfig::FLUIDSYNTH
767     PkgConfig::LIBLO
768     PkgConfig::LIBMAGIC
769     PkgConfig::X11
770     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
771     ${CARLA_PTHREADS}
774 target_sources(carla-bridge-native
775   PRIVATE
776     ../source/bridges-plugin/CarlaBridgePlugin.cpp
777     ../source/backend/CarlaStandalone.cpp
778     ../source/backend/engine/CarlaEngine.cpp
779     ../source/backend/engine/CarlaEngineBridge.cpp
780     ../source/backend/engine/CarlaEngineClient.cpp
781     ../source/backend/engine/CarlaEngineDummy.cpp
782     ../source/backend/engine/CarlaEngineData.cpp
783     ../source/backend/engine/CarlaEngineGraph.cpp
784     ../source/backend/engine/CarlaEngineInternal.cpp
785     ../source/backend/engine/CarlaEnginePorts.cpp
786     ../source/backend/engine/CarlaEngineRunner.cpp
787     ../source/backend/plugin/CarlaPlugin.cpp
788     ../source/backend/plugin/CarlaPluginBridge.cpp
789     ../source/backend/plugin/CarlaPluginInternal.cpp
790     ../source/backend/plugin/CarlaPluginAU.cpp
791     ../source/backend/plugin/CarlaPluginCLAP.cpp
792     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
793     ../source/backend/plugin/CarlaPluginJSFX.cpp
794     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
795     ../source/backend/plugin/CarlaPluginLV2.cpp
796     ../source/backend/plugin/CarlaPluginNative.cpp
797     ../source/backend/plugin/CarlaPluginSFZero.cpp
798     ../source/backend/plugin/CarlaPluginVST2.cpp
799     ../source/backend/plugin/CarlaPluginVST3.cpp
800     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
801     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
804 #######################################################################################################################
805 # carla bridge-lv2-gtk2
807 add_executable(carla-bridge-lv2-gtk2)
809 set_common_target_properties(carla-bridge-lv2-gtk2)
811 if(NOT ${CARLA_BUILD_FRAMEWORKS})
812   install(TARGETS carla-bridge-lv2-gtk2
813     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
814   )
815 endif()
817 target_compile_definitions(carla-bridge-lv2-gtk2
818   PRIVATE
819     BUILD_BRIDGE
820     BUILD_BRIDGE_UI
821     BRIDGE_GTK2
824 target_include_directories(carla-bridge-lv2-gtk2
825   PRIVATE
826     ../source/backend
827     ../source/includes
828     ../source/modules
829     ../source/utils
832 target_link_libraries(carla-bridge-lv2-gtk2
833   PRIVATE
834     carla-lilv
835     carla-water-files
836   PUBLIC
837     PkgConfig::X11
838     ${CARLA_PTHREADS}
841 target_sources(carla-bridge-lv2-gtk2
842   PRIVATE
843     ../source/bridges-ui/CarlaBridgeFormat.cpp
844     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
845     ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
848 #######################################################################################################################
849 # carla bridge-lv2-gtk3
851 add_executable(carla-bridge-lv2-gtk3)
853 set_common_target_properties(carla-bridge-lv2-gtk3)
855 if(NOT ${CARLA_BUILD_FRAMEWORKS})
856   install(TARGETS carla-bridge-lv2-gtk3
857     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
858   )
859 endif()
861 target_compile_definitions(carla-bridge-lv2-gtk3
862   PRIVATE
863     BUILD_BRIDGE
864     BUILD_BRIDGE_UI
865     BRIDGE_GTK3
868 target_include_directories(carla-bridge-lv2-gtk3
869   PRIVATE
870     ../source/backend
871     ../source/includes
872     ../source/modules
873     ../source/utils
876 target_link_libraries(carla-bridge-lv2-gtk3
877   PRIVATE
878     carla-lilv
879     carla-water-files
880   PUBLIC
881     PkgConfig::X11
882     ${CARLA_PTHREADS}
885 target_sources(carla-bridge-lv2-gtk3
886   PRIVATE
887     ../source/bridges-ui/CarlaBridgeFormat.cpp
888     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
889     ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
892 #######################################################################################################################
893 # carla discovery-native
895 add_executable(carla-discovery-native)
897 set_common_target_properties(carla-discovery-native)
899 if(NOT ${CARLA_BUILD_FRAMEWORKS})
900   install(TARGETS carla-discovery-native
901     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
902   )
903 endif()
905 target_include_directories(carla-discovery-native
906   PRIVATE
907     ../source/backend
908     ../source/includes
909     ../source/modules
910     ../source/utils
913 target_link_libraries(carla-discovery-native
914   PRIVATE
915     carla-lilv
916     carla-water-files
917     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
918   PUBLIC
919     PkgConfig::FLUIDSYNTH
920     ${CARLA_PTHREADS}
923 target_sources(carla-discovery-native
924   PRIVATE
925     ../source/discovery/carla-discovery.cpp
928 #######################################################################################################################
929 # carla host-plugin
931 add_library(carla-host-plugin ${CARLA_LIB_TYPE})
932 add_library(carla::host-plugin ALIAS carla-host-plugin)
934 set_common_target_properties(carla-host-plugin)
936 if(${CARLA_BUILD_FRAMEWORKS})
937   set(carla-host-plugin-public-headers
938     ../source/backend/CarlaBackend.h
939     ../source/backend/CarlaHost.h
940     ../source/backend/CarlaUtils.h
941   )
943   set_target_properties(carla-host-plugin
944     PROPERTIES
945       FRAMEWORK TRUE
946       FRAMEWORK_VERSION A
947       OUTPUT_NAME carla-host-plugin
948       PUBLIC_HEADER "${carla-host-plugin-public-headers}"
949       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
950       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.host-plugin"
951       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
952       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
953   )
954 else()
955   set_target_properties(carla-host-plugin
956     PROPERTIES
957       OUTPUT_NAME carla_host-plugin
958       IMPORT_PREFIX lib
959       PREFIX lib
960   )
961 endif()
963 target_compile_definitions(carla-host-plugin
964   PRIVATE
965     CARLA_PLUGIN_BUILD
966     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
969 # FIXME
970 # target_compile_options(carla-host-plugin
971 #   PRIVATE
972 #     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
973 # )
975 target_include_directories(carla-host-plugin
976   PRIVATE
977     ../source
978     ../source/modules
979   PUBLIC
980     ../source/backend
981     ../source/includes
982     ../source/utils
985 target_link_libraries(carla-host-plugin
986   PRIVATE
987     carla-jackbridge
988     carla-lilv
989     carla-native-plugins
990     carla-rtmempool
991     carla-sfzero
992     carla-water
993     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
994     carla-zita-resampler
995   PUBLIC
996     PkgConfig::FLUIDSYNTH
997     PkgConfig::LIBLO
998     PkgConfig::LIBMAGIC
999     PkgConfig::X11
1000     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1001     ${CARLA_PTHREADS}
1004 target_sources(carla-host-plugin
1005   PRIVATE
1006     ../source/backend/engine/CarlaEngine.cpp
1007     ../source/backend/engine/CarlaEngineClient.cpp
1008     ../source/backend/engine/CarlaEngineData.cpp
1009     ../source/backend/engine/CarlaEngineGraph.cpp
1010     ../source/backend/engine/CarlaEngineInternal.cpp
1011     ../source/backend/engine/CarlaEngineNative.cpp
1012     ../source/backend/engine/CarlaEngineOsc.cpp
1013     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1014     ../source/backend/engine/CarlaEngineOscSend.cpp
1015     ../source/backend/engine/CarlaEnginePorts.cpp
1016     ../source/backend/engine/CarlaEngineRunner.cpp
1017     ../source/backend/plugin/CarlaPlugin.cpp
1018     ../source/backend/plugin/CarlaPluginBridge.cpp
1019     ../source/backend/plugin/CarlaPluginInternal.cpp
1020     ../source/backend/plugin/CarlaPluginAU.cpp
1021     ../source/backend/plugin/CarlaPluginCLAP.cpp
1022     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1023     ../source/backend/plugin/CarlaPluginJSFX.cpp
1024     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1025     ../source/backend/plugin/CarlaPluginLV2.cpp
1026     ../source/backend/plugin/CarlaPluginNative.cpp
1027     ../source/backend/plugin/CarlaPluginSFZero.cpp
1028     ../source/backend/plugin/CarlaPluginVST2.cpp
1029     ../source/backend/plugin/CarlaPluginVST3.cpp
1030     ../source/plugin/carla-host-plugin.cpp
1031     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1032   PUBLIC
1033     ${carla-host-plugin-public-headers}
1036 install(TARGETS carla-host-plugin
1037   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1038   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1039   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1040   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1043 if(${CARLA_BUILD_FRAMEWORKS})
1044   install(FILES
1045     ../source/includes/CarlaDefines.h
1046     ../source/includes/CarlaNative.h
1047     ../source/includes/CarlaNativePlugin.h
1048     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1049 endif()
1051 #######################################################################################################################
1052 # carla native-plugin
1054 add_library(carla-native-plugin ${CARLA_LIB_TYPE})
1055 add_library(carla::native-plugin ALIAS carla-native-plugin)
1057 set_common_target_properties(carla-native-plugin)
1059 if(${CARLA_BUILD_FRAMEWORKS})
1060   set(carla-native-plugin-public-headers
1061     ../source/backend/CarlaBackend.h
1062     ../source/backend/CarlaHost.h
1063     ../source/backend/CarlaUtils.h
1064   )
1066   set_target_properties(carla-native-plugin
1067     PROPERTIES
1068       FRAMEWORK TRUE
1069       FRAMEWORK_VERSION A
1070       OUTPUT_NAME carla-native-plugin
1071       PUBLIC_HEADER "${carla-native-plugin-public-headers}"
1072       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1073       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.native-plugin"
1074       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1075       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1076   )
1077 else()
1078   set_target_properties(carla-native-plugin
1079     PROPERTIES
1080       OUTPUT_NAME carla_native-plugin
1081       IMPORT_PREFIX lib
1082       PREFIX lib
1083   )
1084 endif()
1086 target_compile_definitions(carla-native-plugin
1087   PRIVATE
1088     CARLA_PLUGIN_BUILD
1089     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
1092 # FIXME
1093 # target_compile_options(carla-native-plugin
1094 #   PRIVATE
1095 #     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
1096 # )
1098 target_include_directories(carla-native-plugin
1099   PRIVATE
1100     ../source
1101     ../source/modules
1102   PUBLIC
1103     ../source/backend
1104     ../source/includes
1105     ../source/utils
1108 if(APPLE)
1109   target_link_options(carla-native-plugin
1110     PRIVATE
1111       -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
1112       -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
1113       -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
1114       -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
1115       -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
1116       -Wl,-exported_symbol,_carla_get_native_patchbay_cv8_plugin
1117       -Wl,-exported_symbol,_carla_get_native_patchbay_cv32_plugin
1118       -Wl,-exported_symbol,_carla_get_native_patchbay_obs_plugin
1119       -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
1120       -Wl,-exported_symbol,_carla_host_handle_free
1121       -Wl,-exported_symbol,_carla_get_native_plugin_engine
1122       -Wl,-exported_symbol,_carla_get_complete_license_text
1123       -Wl,-exported_symbol,_carla_get_supported_file_extensions
1124       -Wl,-exported_symbol,_carla_get_supported_features
1125       -Wl,-exported_symbol,_carla_get_library_filename
1126       -Wl,-exported_symbol,_carla_get_library_folder
1127   )
1128 elseif(EMSCRIPTEN)
1129   target_link_options(carla-native-plugin
1130     PRIVATE
1131       -sSIDE_MODULE=2
1132       -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']"
1133   )
1134 elseif(MSVC)
1135   target_link_options(carla-native-plugin
1136     PRIVATE
1137       /DEF:${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
1138   )
1139 elseif(WIN32)
1140   target_link_options(carla-native-plugin
1141     PRIVATE
1142       ${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
1143   )
1144 else()
1145   target_link_options(carla-native-plugin
1146     PRIVATE
1147       -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.version
1148   )
1149 endif()
1151 target_link_libraries(carla-native-plugin
1152   PRIVATE
1153     carla-jackbridge
1154     carla-lilv
1155     carla-native-plugins
1156     carla-rtmempool
1157     carla-sfzero
1158     carla-water
1159     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1160     carla-zita-resampler
1161   PUBLIC
1162     PkgConfig::FLUIDSYNTH
1163     PkgConfig::LIBLO
1164     PkgConfig::LIBMAGIC
1165     PkgConfig::X11
1166     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1167     ${CARLA_PTHREADS}
1170 target_sources(carla-native-plugin
1171   PRIVATE
1172     ../source/backend/engine/CarlaEngine.cpp
1173     ../source/backend/engine/CarlaEngineClient.cpp
1174     ../source/backend/engine/CarlaEngineData.cpp
1175     ../source/backend/engine/CarlaEngineGraph.cpp
1176     ../source/backend/engine/CarlaEngineInternal.cpp
1177     ../source/backend/engine/CarlaEngineNative.cpp
1178     ../source/backend/engine/CarlaEngineOsc.cpp
1179     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1180     ../source/backend/engine/CarlaEngineOscSend.cpp
1181     ../source/backend/engine/CarlaEnginePorts.cpp
1182     ../source/backend/engine/CarlaEngineRunner.cpp
1183     ../source/backend/plugin/CarlaPlugin.cpp
1184     ../source/backend/plugin/CarlaPluginBridge.cpp
1185     ../source/backend/plugin/CarlaPluginInternal.cpp
1186     ../source/backend/plugin/CarlaPluginAU.cpp
1187     ../source/backend/plugin/CarlaPluginCLAP.cpp
1188     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1189     ../source/backend/plugin/CarlaPluginJSFX.cpp
1190     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1191     ../source/backend/plugin/CarlaPluginLV2.cpp
1192     ../source/backend/plugin/CarlaPluginNative.cpp
1193     ../source/backend/plugin/CarlaPluginSFZero.cpp
1194     ../source/backend/plugin/CarlaPluginVST2.cpp
1195     ../source/backend/plugin/CarlaPluginVST3.cpp
1196     ../source/plugin/carla-native-plugin.cpp
1197     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1198   PUBLIC
1199     ${carla-native-plugin-public-headers}
1202 install(TARGETS carla-native-plugin
1203   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1204   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1205   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1206   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1209 if(${CARLA_BUILD_FRAMEWORKS})
1210   install(FILES
1211     ../source/includes/CarlaDefines.h
1212     ../source/includes/CarlaNative.h
1213     ../source/includes/CarlaNativePlugin.h
1214     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1215 endif()
1217 #######################################################################################################################
1218 # carla standalone
1220 add_library(carla-standalone ${CARLA_LIB_TYPE})
1221 add_library(carla::standalone ALIAS carla-standalone)
1223 set_common_target_properties(carla-standalone)
1225 if(${CARLA_BUILD_FRAMEWORKS})
1226   set(carla-standalone-public-headers
1227     ../source/backend/CarlaBackend.h
1228     ../source/backend/CarlaHost.h
1229     ../source/backend/CarlaEngine.hpp
1230     ../source/backend/CarlaPlugin.hpp
1231     ../source/backend/CarlaPluginPtr.hpp
1232   )
1234   set_target_properties(carla-standalone
1235     PROPERTIES
1236       FRAMEWORK TRUE
1237       FRAMEWORK_VERSION A
1238       OUTPUT_NAME carla-standalone
1239       PUBLIC_HEADER "${carla-standalone-public-headers}"
1240       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1241       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.standalone"
1242       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1243       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1244   )
1245 else()
1246   set_target_properties(carla-standalone
1247     PROPERTIES
1248       OUTPUT_NAME carla_standalone2
1249       IMPORT_PREFIX lib
1250       PREFIX lib
1251   )
1252 endif()
1254 target_compile_definitions(carla-standalone
1255   PRIVATE
1256     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
1259 # FIXME
1260 target_compile_options(carla-standalone
1261   PRIVATE
1262     $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
1263     $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
1264     $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
1265     $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
1266     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
1269 target_include_directories(carla-standalone
1270   PRIVATE
1271     ../source
1272     ../source/modules
1273   PUBLIC
1274     ../source/backend
1275     ../source/includes
1276     ../source/utils
1279 target_link_libraries(carla-standalone
1280   PRIVATE
1281     carla-jackbridge
1282     carla-lilv
1283     carla-native-plugins
1284     carla-rtmempool
1285     carla-sfzero
1286     carla-water
1287     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1288     carla-zita-resampler
1289   PUBLIC
1290     PkgConfig::FLUIDSYNTH
1291     PkgConfig::LIBLO
1292     PkgConfig::LIBMAGIC
1293     PkgConfig::X11
1294     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1295     ${CARLA_PTHREADS}
1298 target_sources(carla-standalone
1299   PRIVATE
1300     ../source/backend/CarlaStandalone.cpp
1301     ../source/backend/CarlaStandaloneNSM.cpp
1302     ../source/backend/engine/CarlaEngine.cpp
1303     ../source/backend/engine/CarlaEngineClient.cpp
1304     ../source/backend/engine/CarlaEngineDummy.cpp
1305     ../source/backend/engine/CarlaEngineData.cpp
1306     ../source/backend/engine/CarlaEngineGraph.cpp
1307     ../source/backend/engine/CarlaEngineInternal.cpp
1308     ../source/backend/engine/CarlaEngineNative.cpp
1309     ../source/backend/engine/CarlaEngineOsc.cpp
1310     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1311     ../source/backend/engine/CarlaEngineOscSend.cpp
1312     ../source/backend/engine/CarlaEnginePorts.cpp
1313     ../source/backend/engine/CarlaEngineRunner.cpp
1314     ../source/backend/plugin/CarlaPlugin.cpp
1315     ../source/backend/plugin/CarlaPluginBridge.cpp
1316     ../source/backend/plugin/CarlaPluginInternal.cpp
1317     ../source/backend/plugin/CarlaPluginAU.cpp
1318     ../source/backend/plugin/CarlaPluginCLAP.cpp
1319     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1320     ../source/backend/plugin/CarlaPluginJSFX.cpp
1321     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1322     ../source/backend/plugin/CarlaPluginLV2.cpp
1323     ../source/backend/plugin/CarlaPluginNative.cpp
1324     ../source/backend/plugin/CarlaPluginSFZero.cpp
1325     ../source/backend/plugin/CarlaPluginVST2.cpp
1326     ../source/backend/plugin/CarlaPluginVST3.cpp
1327     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
1328     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1329   PUBLIC
1330     ${carla-standalone-public-headers}
1333 install(TARGETS carla-standalone
1334   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1335   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1336   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1337   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1340 if(${CARLA_BUILD_FRAMEWORKS})
1341   install(TARGETS
1342     carla-bridge-lv2-gtk2
1343     carla-bridge-lv2-gtk3
1344     carla-bridge-native
1345     carla-discovery-native
1346     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A)
1348   install(FILES
1349     ../source/includes/CarlaDefines.h
1350     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1352   install(FILES
1353     ../source/utils/CarlaUtils.hpp
1354     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/utils)
1356   install(CODE
1357     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1358       Versions/Current/carla-bridge-lv2-gtk2
1359       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk2)")
1360   install(CODE
1361     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1362       Versions/Current/carla-bridge-lv2-gtk3
1363       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk3)")
1364   install(CODE
1365     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1366       Versions/Current/carla-bridge-native
1367       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-native)")
1368   install(CODE
1369     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1370       Versions/Current/carla-discovery-native
1371       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-discovery-native)")
1372 endif()
1374 #######################################################################################################################
1375 # carla utils
1377 add_library(carla-utils ${CARLA_LIB_TYPE})
1378 add_library(carla::utils ALIAS carla-utils)
1380 set_common_target_properties(carla-utils)
1382 if(${CARLA_BUILD_FRAMEWORKS})
1383   set(carla-utils-public-headers
1384     ../source/backend/CarlaBackend.h
1385     ../source/backend/CarlaUtils.h
1386   )
1388   set_target_properties(carla-utils
1389     PROPERTIES
1390       FRAMEWORK TRUE
1391       FRAMEWORK_VERSION A
1392       OUTPUT_NAME carla-utils
1393       PUBLIC_HEADER "${carla-utils-public-headers}"
1394       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1395       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.utils"
1396       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1397       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1398   )
1399 else()
1400   set_target_properties(carla-utils
1401     PROPERTIES
1402       OUTPUT_NAME carla_utils
1403       IMPORT_PREFIX lib
1404       PREFIX lib
1405   )
1406 endif()
1408 target_include_directories(carla-utils
1409   PRIVATE
1410     ../source
1411     ../source/modules
1412   PUBLIC
1413     ../source/backend
1414     ../source/includes
1415     ../source/utils
1418 target_link_libraries(carla-utils
1419   PRIVATE
1420     carla-jackbridge
1421     carla-lilv
1422     carla-water-files
1423     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1424   PUBLIC
1425     PkgConfig::FLUIDSYNTH
1426     PkgConfig::LIBMAGIC
1427     PkgConfig::X11
1428     ${CARLA_PTHREADS}
1429     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1430     $<$<BOOL:${WIN32}>:winmm>
1433 target_sources(carla-utils
1434   PRIVATE
1435     ../source/backend/utils/CachedPlugins.cpp
1436     ../source/backend/utils/CarlaUtils.cpp
1437     ../source/backend/utils/Information.cpp
1438     ../source/backend/utils/PipeClient.cpp
1439     ../source/backend/utils/PluginDiscovery.cpp
1440     ../source/backend/utils/System.cpp
1441     ../source/backend/utils/Windows.cpp
1442   PUBLIC
1443     ${carla-utils-public-headers}
1446 install(TARGETS carla-utils
1447   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1448   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1449   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1450   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1453 if(${CARLA_BUILD_FRAMEWORKS})
1454   install(TARGETS
1455     carla-bridge-lv2-gtk2
1456     carla-bridge-lv2-gtk3
1457     carla-bridge-native
1458     carla-discovery-native
1459     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A)
1461   install(FILES
1462     ../source/includes/CarlaDefines.h
1463     ../source/includes/CarlaMIDI.h
1464     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/includes)
1466   install(FILES
1467     ../source/utils/CarlaBackendUtils.hpp
1468     ../source/utils/CarlaBase64Utils.hpp
1469     ../source/utils/CarlaBinaryUtils.hpp
1470     ../source/utils/CarlaBridgeDefines.hpp
1471     ../source/utils/CarlaBridgeUtils.hpp
1472     ../source/utils/CarlaMacUtils.hpp
1473     ../source/utils/CarlaMathUtils.hpp
1474     ../source/utils/CarlaMemUtils.hpp
1475     ../source/utils/CarlaMutex.hpp
1476     ../source/utils/CarlaRingBuffer.hpp
1477     ../source/utils/CarlaProcessUtils.hpp
1478     ../source/utils/CarlaRunner.hpp
1479     ../source/utils/CarlaScopeUtils.hpp
1480     ../source/utils/CarlaSemUtils.hpp
1481     ../source/utils/CarlaSha1Utils.hpp
1482     ../source/utils/CarlaShmUtils.hpp
1483     ../source/utils/CarlaString.hpp
1484     ../source/utils/CarlaThread.hpp
1485     ../source/utils/CarlaTimeUtils.hpp
1486     ../source/utils/CarlaUtils.hpp
1487     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/utils)
1489   install(CODE
1490     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1491       Versions/Current/carla-bridge-lv2-gtk2
1492       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk2)")
1493   install(CODE
1494     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1495       Versions/Current/carla-bridge-lv2-gtk3
1496       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk3)")
1497   install(CODE
1498     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1499       Versions/Current/carla-bridge-native
1500       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-native)")
1501   install(CODE
1502     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1503       Versions/Current/carla-discovery-native
1504       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-discovery-native)")
1505 endif()
1507 #######################################################################################################################
1509 if(APPLE)
1510   set_source_files_properties(
1511     ../source/backend/CarlaStandalone.cpp
1512     ../source/backend/engine/CarlaEngineNative.cpp
1513     ../source/backend/plugin/CarlaPluginAU.cpp
1514     ../source/backend/plugin/CarlaPluginCLAP.cpp
1515     ../source/backend/plugin/CarlaPluginVST2.cpp
1516     ../source/backend/plugin/CarlaPluginVST3.cpp
1517     ../source/backend/utils/CarlaUtils.cpp
1518     ../source/backend/utils/Windows.cpp
1519     ../source/bridges-plugin/CarlaBridgePlugin.cpp
1520     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
1521     ../source/discovery/carla-discovery.cpp
1522     ../source/modules/water/water.cpp
1523     ../source/modules/water/water.files.cpp
1524     PROPERTIES COMPILE_FLAGS -ObjC++)
1525 endif()
1527 #######################################################################################################################
1528 # install code headers
1530 add_library(carla-headers-backend INTERFACE)
1531 add_library(carla-headers-includes INTERFACE)
1532 add_library(carla-headers-utils INTERFACE)
1534 set_property(TARGET carla-headers-backend
1535   PROPERTY PUBLIC_HEADER
1536     ../source/backend/CarlaBackend.h
1537     ../source/backend/CarlaHost.h
1538     ../source/backend/CarlaUtils.h
1539     ../source/backend/CarlaEngine.hpp
1540     ../source/backend/CarlaPlugin.hpp
1541     ../source/backend/CarlaPluginPtr.hpp
1544 set_property(TARGET carla-headers-includes
1545   PROPERTY PUBLIC_HEADER
1546     ../source/includes/CarlaDefines.h
1547     ../source/includes/CarlaMIDI.h
1548     ../source/includes/CarlaNative.h
1549     ../source/includes/CarlaNativePlugin.h
1552 set_property(TARGET carla-headers-utils
1553   PROPERTY PUBLIC_HEADER
1554     ../source/utils/CarlaBackendUtils.hpp
1555     ../source/utils/CarlaBase64Utils.hpp
1556     ../source/utils/CarlaBinaryUtils.hpp
1557     ../source/utils/CarlaBridgeDefines.hpp
1558     ../source/utils/CarlaBridgeUtils.hpp
1559     ../source/utils/CarlaMacUtils.hpp
1560     ../source/utils/CarlaMathUtils.hpp
1561     ../source/utils/CarlaMemUtils.hpp
1562     ../source/utils/CarlaMutex.hpp
1563     ../source/utils/CarlaRingBuffer.hpp
1564     ../source/utils/CarlaProcessUtils.hpp
1565     ../source/utils/CarlaRunner.hpp
1566     ../source/utils/CarlaScopeUtils.hpp
1567     ../source/utils/CarlaSemUtils.hpp
1568     ../source/utils/CarlaSha1Utils.hpp
1569     ../source/utils/CarlaShmUtils.hpp
1570     ../source/utils/CarlaString.hpp
1571     ../source/utils/CarlaThread.hpp
1572     ../source/utils/CarlaTimeUtils.hpp
1573     ../source/utils/CarlaUtils.hpp
1576 install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
1577 install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
1578 install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
1580 #######################################################################################################################
1581 # pkg-config stuff
1583 if(NOT ${CARLA_BUILD_FRAMEWORKS} AND NOT MSVC)
1584   configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
1585   configure_file(carla-standalone.pc.in carla-standalone.pc @ONLY)
1586   configure_file(carla-native-plugin.pc.in carla-native-plugin.pc @ONLY)
1587   configure_file(carla-host-plugin.pc.in carla-host-plugin.pc @ONLY)
1589   install(FILES
1590     ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
1591     ${CMAKE_CURRENT_BINARY_DIR}/carla-standalone.pc
1592     ${CMAKE_CURRENT_BINARY_DIR}/carla-native-plugin.pc
1593     ${CMAKE_CURRENT_BINARY_DIR}/carla-host-plugin.pc
1594     DESTINATION
1595       ${CMAKE_INSTALL_LIBDIR}/pkgconfig
1596   )
1597 endif()
1599 #######################################################################################################################