Update CI version
[carla.git] / cmake / CMakeLists.txt
blobc0a817e07c8793fe5fe8cc95c1b14f67fd798463
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/CarlaPluginJuce.cpp
794     ../source/backend/plugin/CarlaPluginJSFX.cpp
795     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
796     ../source/backend/plugin/CarlaPluginLV2.cpp
797     ../source/backend/plugin/CarlaPluginNative.cpp
798     ../source/backend/plugin/CarlaPluginSFZero.cpp
799     ../source/backend/plugin/CarlaPluginVST2.cpp
800     ../source/backend/plugin/CarlaPluginVST3.cpp
801     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
802     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
805 #######################################################################################################################
806 # carla bridge-lv2-gtk2
808 add_executable(carla-bridge-lv2-gtk2)
810 set_common_target_properties(carla-bridge-lv2-gtk2)
812 if(NOT ${CARLA_BUILD_FRAMEWORKS})
813   install(TARGETS carla-bridge-lv2-gtk2
814     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
815   )
816 endif()
818 target_compile_definitions(carla-bridge-lv2-gtk2
819   PRIVATE
820     BUILD_BRIDGE
821     BUILD_BRIDGE_UI
822     BRIDGE_GTK2
825 target_include_directories(carla-bridge-lv2-gtk2
826   PRIVATE
827     ../source/backend
828     ../source/includes
829     ../source/modules
830     ../source/utils
833 target_link_libraries(carla-bridge-lv2-gtk2
834   PRIVATE
835     carla-lilv
836     carla-water-files
837   PUBLIC
838     PkgConfig::X11
839     ${CARLA_PTHREADS}
842 target_sources(carla-bridge-lv2-gtk2
843   PRIVATE
844     ../source/bridges-ui/CarlaBridgeFormat.cpp
845     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
846     ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
849 #######################################################################################################################
850 # carla bridge-lv2-gtk3
852 add_executable(carla-bridge-lv2-gtk3)
854 set_common_target_properties(carla-bridge-lv2-gtk3)
856 if(NOT ${CARLA_BUILD_FRAMEWORKS})
857   install(TARGETS carla-bridge-lv2-gtk3
858     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
859   )
860 endif()
862 target_compile_definitions(carla-bridge-lv2-gtk3
863   PRIVATE
864     BUILD_BRIDGE
865     BUILD_BRIDGE_UI
866     BRIDGE_GTK3
869 target_include_directories(carla-bridge-lv2-gtk3
870   PRIVATE
871     ../source/backend
872     ../source/includes
873     ../source/modules
874     ../source/utils
877 target_link_libraries(carla-bridge-lv2-gtk3
878   PRIVATE
879     carla-lilv
880     carla-water-files
881   PUBLIC
882     PkgConfig::X11
883     ${CARLA_PTHREADS}
886 target_sources(carla-bridge-lv2-gtk3
887   PRIVATE
888     ../source/bridges-ui/CarlaBridgeFormat.cpp
889     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
890     ../source/bridges-ui/CarlaBridgeToolkitGtk.cpp
893 #######################################################################################################################
894 # carla discovery-native
896 add_executable(carla-discovery-native)
898 set_common_target_properties(carla-discovery-native)
900 if(NOT ${CARLA_BUILD_FRAMEWORKS})
901   install(TARGETS carla-discovery-native
902     RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
903   )
904 endif()
906 target_include_directories(carla-discovery-native
907   PRIVATE
908     ../source/backend
909     ../source/includes
910     ../source/modules
911     ../source/utils
914 target_link_libraries(carla-discovery-native
915   PRIVATE
916     carla-lilv
917     carla-water-files
918     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
919   PUBLIC
920     PkgConfig::FLUIDSYNTH
921     ${CARLA_PTHREADS}
924 target_sources(carla-discovery-native
925   PRIVATE
926     ../source/discovery/carla-discovery.cpp
929 #######################################################################################################################
930 # carla host-plugin
932 add_library(carla-host-plugin ${CARLA_LIB_TYPE})
933 add_library(carla::host-plugin ALIAS carla-host-plugin)
935 set_common_target_properties(carla-host-plugin)
937 if(${CARLA_BUILD_FRAMEWORKS})
938   set(carla-host-plugin-public-headers
939     ../source/backend/CarlaBackend.h
940     ../source/backend/CarlaHost.h
941     ../source/backend/CarlaUtils.h
942   )
944   set_target_properties(carla-host-plugin
945     PROPERTIES
946       FRAMEWORK TRUE
947       FRAMEWORK_VERSION A
948       OUTPUT_NAME carla-host-plugin
949       PUBLIC_HEADER "${carla-host-plugin-public-headers}"
950       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
951       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.host-plugin"
952       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
953       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
954   )
955 else()
956   set_target_properties(carla-host-plugin
957     PROPERTIES
958       OUTPUT_NAME carla_host-plugin
959       IMPORT_PREFIX lib
960       PREFIX lib
961   )
962 endif()
964 target_compile_definitions(carla-host-plugin
965   PRIVATE
966     CARLA_PLUGIN_BUILD
967     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
970 # FIXME
971 # target_compile_options(carla-host-plugin
972 #   PRIVATE
973 #     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
974 # )
976 target_include_directories(carla-host-plugin
977   PRIVATE
978     ../source
979     ../source/modules
980   PUBLIC
981     ../source/backend
982     ../source/includes
983     ../source/utils
986 target_link_libraries(carla-host-plugin
987   PRIVATE
988     carla-jackbridge
989     carla-lilv
990     carla-native-plugins
991     carla-rtmempool
992     carla-sfzero
993     carla-water
994     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
995     carla-zita-resampler
996   PUBLIC
997     PkgConfig::FLUIDSYNTH
998     PkgConfig::LIBLO
999     PkgConfig::LIBMAGIC
1000     PkgConfig::X11
1001     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1002     ${CARLA_PTHREADS}
1005 target_sources(carla-host-plugin
1006   PRIVATE
1007     ../source/backend/engine/CarlaEngine.cpp
1008     ../source/backend/engine/CarlaEngineClient.cpp
1009     ../source/backend/engine/CarlaEngineData.cpp
1010     ../source/backend/engine/CarlaEngineGraph.cpp
1011     ../source/backend/engine/CarlaEngineInternal.cpp
1012     ../source/backend/engine/CarlaEngineNative.cpp
1013     ../source/backend/engine/CarlaEngineOsc.cpp
1014     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1015     ../source/backend/engine/CarlaEngineOscSend.cpp
1016     ../source/backend/engine/CarlaEnginePorts.cpp
1017     ../source/backend/engine/CarlaEngineRunner.cpp
1018     ../source/backend/plugin/CarlaPlugin.cpp
1019     ../source/backend/plugin/CarlaPluginBridge.cpp
1020     ../source/backend/plugin/CarlaPluginInternal.cpp
1021     ../source/backend/plugin/CarlaPluginAU.cpp
1022     ../source/backend/plugin/CarlaPluginCLAP.cpp
1023     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1024     ../source/backend/plugin/CarlaPluginJuce.cpp
1025     ../source/backend/plugin/CarlaPluginJSFX.cpp
1026     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1027     ../source/backend/plugin/CarlaPluginLV2.cpp
1028     ../source/backend/plugin/CarlaPluginNative.cpp
1029     ../source/backend/plugin/CarlaPluginSFZero.cpp
1030     ../source/backend/plugin/CarlaPluginVST2.cpp
1031     ../source/backend/plugin/CarlaPluginVST3.cpp
1032     ../source/plugin/carla-host-plugin.cpp
1033     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1034   PUBLIC
1035     ${carla-host-plugin-public-headers}
1038 install(TARGETS carla-host-plugin
1039   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1040   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1041   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1042   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1045 if(${CARLA_BUILD_FRAMEWORKS})
1046   install(FILES
1047     ../source/includes/CarlaDefines.h
1048     ../source/includes/CarlaNative.h
1049     ../source/includes/CarlaNativePlugin.h
1050     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1051 endif()
1053 #######################################################################################################################
1054 # carla native-plugin
1056 add_library(carla-native-plugin ${CARLA_LIB_TYPE})
1057 add_library(carla::native-plugin ALIAS carla-native-plugin)
1059 set_common_target_properties(carla-native-plugin)
1061 if(${CARLA_BUILD_FRAMEWORKS})
1062   set(carla-native-plugin-public-headers
1063     ../source/backend/CarlaBackend.h
1064     ../source/backend/CarlaHost.h
1065     ../source/backend/CarlaUtils.h
1066   )
1068   set_target_properties(carla-native-plugin
1069     PROPERTIES
1070       FRAMEWORK TRUE
1071       FRAMEWORK_VERSION A
1072       OUTPUT_NAME carla-native-plugin
1073       PUBLIC_HEADER "${carla-native-plugin-public-headers}"
1074       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1075       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.native-plugin"
1076       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1077       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1078   )
1079 else()
1080   set_target_properties(carla-native-plugin
1081     PROPERTIES
1082       OUTPUT_NAME carla_native-plugin
1083       IMPORT_PREFIX lib
1084       PREFIX lib
1085   )
1086 endif()
1088 target_compile_definitions(carla-native-plugin
1089   PRIVATE
1090     CARLA_PLUGIN_BUILD
1091     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
1094 # FIXME
1095 # target_compile_options(carla-native-plugin
1096 #   PRIVATE
1097 #     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
1098 # )
1100 target_include_directories(carla-native-plugin
1101   PRIVATE
1102     ../source
1103     ../source/modules
1104   PUBLIC
1105     ../source/backend
1106     ../source/includes
1107     ../source/utils
1110 if(APPLE)
1111   target_link_options(carla-native-plugin
1112     PRIVATE
1113       -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
1114       -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
1115       -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
1116       -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
1117       -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
1118       -Wl,-exported_symbol,_carla_get_native_patchbay_cv8_plugin
1119       -Wl,-exported_symbol,_carla_get_native_patchbay_cv32_plugin
1120       -Wl,-exported_symbol,_carla_get_native_patchbay_obs_plugin
1121       -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
1122       -Wl,-exported_symbol,_carla_host_handle_free
1123       -Wl,-exported_symbol,_carla_get_native_plugin_engine
1124       -Wl,-exported_symbol,_carla_get_complete_license_text
1125       -Wl,-exported_symbol,_carla_get_juce_version
1126       -Wl,-exported_symbol,_carla_get_supported_file_extensions
1127       -Wl,-exported_symbol,_carla_get_supported_features
1128       -Wl,-exported_symbol,_carla_get_library_filename
1129       -Wl,-exported_symbol,_carla_get_library_folder
1130   )
1131 elseif(EMSCRIPTEN)
1132   target_link_options(carla-native-plugin
1133     PRIVATE
1134       -sSIDE_MODULE=2
1135       -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']"
1136   )
1137 elseif(MSVC)
1138   target_link_options(carla-native-plugin
1139     PRIVATE
1140       /DEF:${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
1141   )
1142 elseif(WIN32)
1143   target_link_options(carla-native-plugin
1144     PRIVATE
1145       ${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.def
1146   )
1147 else()
1148   target_link_options(carla-native-plugin
1149     PRIVATE
1150       -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../source/plugin/symbols/carla-native-plugin.version
1151   )
1152 endif()
1154 target_link_libraries(carla-native-plugin
1155   PRIVATE
1156     carla-jackbridge
1157     carla-lilv
1158     carla-native-plugins
1159     carla-rtmempool
1160     carla-sfzero
1161     carla-water
1162     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1163     carla-zita-resampler
1164   PUBLIC
1165     PkgConfig::FLUIDSYNTH
1166     PkgConfig::LIBLO
1167     PkgConfig::LIBMAGIC
1168     PkgConfig::X11
1169     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1170     ${CARLA_PTHREADS}
1173 target_sources(carla-native-plugin
1174   PRIVATE
1175     ../source/backend/engine/CarlaEngine.cpp
1176     ../source/backend/engine/CarlaEngineClient.cpp
1177     ../source/backend/engine/CarlaEngineData.cpp
1178     ../source/backend/engine/CarlaEngineGraph.cpp
1179     ../source/backend/engine/CarlaEngineInternal.cpp
1180     ../source/backend/engine/CarlaEngineNative.cpp
1181     ../source/backend/engine/CarlaEngineOsc.cpp
1182     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1183     ../source/backend/engine/CarlaEngineOscSend.cpp
1184     ../source/backend/engine/CarlaEnginePorts.cpp
1185     ../source/backend/engine/CarlaEngineRunner.cpp
1186     ../source/backend/plugin/CarlaPlugin.cpp
1187     ../source/backend/plugin/CarlaPluginBridge.cpp
1188     ../source/backend/plugin/CarlaPluginInternal.cpp
1189     ../source/backend/plugin/CarlaPluginAU.cpp
1190     ../source/backend/plugin/CarlaPluginCLAP.cpp
1191     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1192     ../source/backend/plugin/CarlaPluginJuce.cpp
1193     ../source/backend/plugin/CarlaPluginJSFX.cpp
1194     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1195     ../source/backend/plugin/CarlaPluginLV2.cpp
1196     ../source/backend/plugin/CarlaPluginNative.cpp
1197     ../source/backend/plugin/CarlaPluginSFZero.cpp
1198     ../source/backend/plugin/CarlaPluginVST2.cpp
1199     ../source/backend/plugin/CarlaPluginVST3.cpp
1200     ../source/plugin/carla-native-plugin.cpp
1201     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1202   PUBLIC
1203     ${carla-native-plugin-public-headers}
1206 install(TARGETS carla-native-plugin
1207   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1208   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1209   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1210   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1213 if(${CARLA_BUILD_FRAMEWORKS})
1214   install(FILES
1215     ../source/includes/CarlaDefines.h
1216     ../source/includes/CarlaNative.h
1217     ../source/includes/CarlaNativePlugin.h
1218     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1219 endif()
1221 #######################################################################################################################
1222 # carla standalone
1224 add_library(carla-standalone ${CARLA_LIB_TYPE})
1225 add_library(carla::standalone ALIAS carla-standalone)
1227 set_common_target_properties(carla-standalone)
1229 if(${CARLA_BUILD_FRAMEWORKS})
1230   set(carla-standalone-public-headers
1231     ../source/backend/CarlaBackend.h
1232     ../source/backend/CarlaHost.h
1233     ../source/backend/CarlaEngine.hpp
1234     ../source/backend/CarlaPlugin.hpp
1235     ../source/backend/CarlaPluginPtr.hpp
1236   )
1238   set_target_properties(carla-standalone
1239     PROPERTIES
1240       FRAMEWORK TRUE
1241       FRAMEWORK_VERSION A
1242       OUTPUT_NAME carla-standalone
1243       PUBLIC_HEADER "${carla-standalone-public-headers}"
1244       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1245       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.standalone"
1246       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1247       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1248   )
1249 else()
1250   set_target_properties(carla-standalone
1251     PROPERTIES
1252       OUTPUT_NAME carla_standalone2
1253       IMPORT_PREFIX lib
1254       PREFIX lib
1255   )
1256 endif()
1258 target_compile_definitions(carla-standalone
1259   PRIVATE
1260     CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
1263 # FIXME
1264 target_compile_options(carla-standalone
1265   PRIVATE
1266     $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
1267     $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
1268     $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
1269     $<$<C_COMPILER_ID:GNU>:-Wno-unused-but-set-variable>
1270     $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
1273 target_include_directories(carla-standalone
1274   PRIVATE
1275     ../source
1276     ../source/modules
1277   PUBLIC
1278     ../source/backend
1279     ../source/includes
1280     ../source/utils
1283 target_link_libraries(carla-standalone
1284   PRIVATE
1285     carla-jackbridge
1286     carla-lilv
1287     carla-native-plugins
1288     carla-rtmempool
1289     carla-sfzero
1290     carla-water
1291     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1292     carla-zita-resampler
1293   PUBLIC
1294     PkgConfig::FLUIDSYNTH
1295     PkgConfig::LIBLO
1296     PkgConfig::LIBMAGIC
1297     PkgConfig::X11
1298     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1299     ${CARLA_PTHREADS}
1302 target_sources(carla-standalone
1303   PRIVATE
1304     ../source/backend/CarlaStandalone.cpp
1305     ../source/backend/CarlaStandaloneNSM.cpp
1306     ../source/backend/engine/CarlaEngine.cpp
1307     ../source/backend/engine/CarlaEngineClient.cpp
1308     ../source/backend/engine/CarlaEngineDummy.cpp
1309     ../source/backend/engine/CarlaEngineData.cpp
1310     ../source/backend/engine/CarlaEngineGraph.cpp
1311     ../source/backend/engine/CarlaEngineInternal.cpp
1312     ../source/backend/engine/CarlaEngineNative.cpp
1313     ../source/backend/engine/CarlaEngineOsc.cpp
1314     ../source/backend/engine/CarlaEngineOscHandlers.cpp
1315     ../source/backend/engine/CarlaEngineOscSend.cpp
1316     ../source/backend/engine/CarlaEnginePorts.cpp
1317     ../source/backend/engine/CarlaEngineRunner.cpp
1318     ../source/backend/plugin/CarlaPlugin.cpp
1319     ../source/backend/plugin/CarlaPluginBridge.cpp
1320     ../source/backend/plugin/CarlaPluginInternal.cpp
1321     ../source/backend/plugin/CarlaPluginAU.cpp
1322     ../source/backend/plugin/CarlaPluginCLAP.cpp
1323     ../source/backend/plugin/CarlaPluginFluidSynth.cpp
1324     ../source/backend/plugin/CarlaPluginJuce.cpp
1325     ../source/backend/plugin/CarlaPluginJSFX.cpp
1326     ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
1327     ../source/backend/plugin/CarlaPluginLV2.cpp
1328     ../source/backend/plugin/CarlaPluginNative.cpp
1329     ../source/backend/plugin/CarlaPluginSFZero.cpp
1330     ../source/backend/plugin/CarlaPluginVST2.cpp
1331     ../source/backend/plugin/CarlaPluginVST3.cpp
1332     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
1333     $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
1334   PUBLIC
1335     ${carla-standalone-public-headers}
1338 install(TARGETS carla-standalone
1339   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1340   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1341   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1342   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1345 if(${CARLA_BUILD_FRAMEWORKS})
1346   install(TARGETS
1347     carla-bridge-lv2-gtk2
1348     carla-bridge-lv2-gtk3
1349     carla-bridge-native
1350     carla-discovery-native
1351     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A)
1353   install(FILES
1354     ../source/includes/CarlaDefines.h
1355     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes)
1357   install(FILES
1358     ../source/utils/CarlaUtils.hpp
1359     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/utils)
1361   install(CODE
1362     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1363       Versions/Current/carla-bridge-lv2-gtk2
1364       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk2)")
1365   install(CODE
1366     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1367       Versions/Current/carla-bridge-lv2-gtk3
1368       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-lv2-gtk3)")
1369   install(CODE
1370     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1371       Versions/Current/carla-bridge-native
1372       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-bridge-native)")
1373   install(CODE
1374     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1375       Versions/Current/carla-discovery-native
1376       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-standalone.framework/carla-discovery-native)")
1377 endif()
1379 #######################################################################################################################
1380 # carla utils
1382 add_library(carla-utils ${CARLA_LIB_TYPE})
1383 add_library(carla::utils ALIAS carla-utils)
1385 set_common_target_properties(carla-utils)
1387 if(${CARLA_BUILD_FRAMEWORKS})
1388   set(carla-utils-public-headers
1389     ../source/backend/CarlaBackend.h
1390     ../source/backend/CarlaUtils.h
1391   )
1393   set_target_properties(carla-utils
1394     PROPERTIES
1395       FRAMEWORK TRUE
1396       FRAMEWORK_VERSION A
1397       OUTPUT_NAME carla-utils
1398       PUBLIC_HEADER "${carla-utils-public-headers}"
1399       MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in"
1400       MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.utils"
1401       MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}"
1402       MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}"
1403   )
1404 else()
1405   set_target_properties(carla-utils
1406     PROPERTIES
1407       OUTPUT_NAME carla_utils
1408       IMPORT_PREFIX lib
1409       PREFIX lib
1410   )
1411 endif()
1413 target_include_directories(carla-utils
1414   PRIVATE
1415     ../source
1416     ../source/modules
1417   PUBLIC
1418     ../source/backend
1419     ../source/includes
1420     ../source/utils
1423 target_link_libraries(carla-utils
1424   PRIVATE
1425     carla-jackbridge
1426     carla-lilv
1427     carla-water-files
1428     $<$<BOOL:${CARLA_ENABLE_JSFX}>:carla-ysfx>
1429   PUBLIC
1430     PkgConfig::FLUIDSYNTH
1431     PkgConfig::LIBMAGIC
1432     PkgConfig::X11
1433     ${CARLA_PTHREADS}
1434     $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>
1435     $<$<BOOL:${WIN32}>:winmm>
1438 target_sources(carla-utils
1439   PRIVATE
1440     ../source/backend/utils/CachedPlugins.cpp
1441     ../source/backend/utils/CarlaUtils.cpp
1442     ../source/backend/utils/Information.cpp
1443     ../source/backend/utils/JUCE.cpp
1444     ../source/backend/utils/PipeClient.cpp
1445     ../source/backend/utils/PluginDiscovery.cpp
1446     ../source/backend/utils/System.cpp
1447     ../source/backend/utils/Windows.cpp
1448   PUBLIC
1449     ${carla-utils-public-headers}
1452 install(TARGETS carla-utils
1453   ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR}
1454   LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR}
1455   RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR}
1456   FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
1459 if(${CARLA_BUILD_FRAMEWORKS})
1460   install(TARGETS
1461     carla-bridge-lv2-gtk2
1462     carla-bridge-lv2-gtk3
1463     carla-bridge-native
1464     carla-discovery-native
1465     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A)
1467   install(FILES
1468     ../source/includes/CarlaDefines.h
1469     ../source/includes/CarlaMIDI.h
1470     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/includes)
1472   install(FILES
1473     ../source/utils/CarlaBackendUtils.hpp
1474     ../source/utils/CarlaBase64Utils.hpp
1475     ../source/utils/CarlaBinaryUtils.hpp
1476     ../source/utils/CarlaBridgeDefines.hpp
1477     ../source/utils/CarlaBridgeUtils.hpp
1478     ../source/utils/CarlaMacUtils.hpp
1479     ../source/utils/CarlaMathUtils.hpp
1480     ../source/utils/CarlaMemUtils.hpp
1481     ../source/utils/CarlaMutex.hpp
1482     ../source/utils/CarlaRingBuffer.hpp
1483     ../source/utils/CarlaProcessUtils.hpp
1484     ../source/utils/CarlaRunner.hpp
1485     ../source/utils/CarlaScopeUtils.hpp
1486     ../source/utils/CarlaSemUtils.hpp
1487     ../source/utils/CarlaSha1Utils.hpp
1488     ../source/utils/CarlaShmUtils.hpp
1489     ../source/utils/CarlaString.hpp
1490     ../source/utils/CarlaThread.hpp
1491     ../source/utils/CarlaTimeUtils.hpp
1492     ../source/utils/CarlaUtils.hpp
1493     DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-utils.framework/Versions/A/Headers/utils)
1495   install(CODE
1496     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1497       Versions/Current/carla-bridge-lv2-gtk2
1498       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk2)")
1499   install(CODE
1500     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1501       Versions/Current/carla-bridge-lv2-gtk3
1502       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-lv2-gtk3)")
1503   install(CODE
1504     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1505       Versions/Current/carla-bridge-native
1506       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-bridge-native)")
1507   install(CODE
1508     "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1509       Versions/Current/carla-discovery-native
1510       $ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/carla-utils.framework/carla-discovery-native)")
1511 endif()
1513 #######################################################################################################################
1515 if(APPLE)
1516   set_source_files_properties(
1517     ../source/backend/CarlaStandalone.cpp
1518     ../source/backend/engine/CarlaEngineNative.cpp
1519     ../source/backend/plugin/CarlaPluginCLAP.cpp
1520     ../source/backend/plugin/CarlaPluginVST2.cpp
1521     ../source/backend/plugin/CarlaPluginVST3.cpp
1522     ../source/backend/utils/CarlaUtils.cpp
1523     ../source/backend/utils/Windows.cpp
1524     ../source/bridges-plugin/CarlaBridgePlugin.cpp
1525     ../source/bridges-ui/CarlaBridgeFormatLV2.cpp
1526     ../source/discovery/carla-discovery.cpp
1527     ../source/modules/water/water.cpp
1528     ../source/modules/water/water.files.cpp
1529     PROPERTIES COMPILE_FLAGS -ObjC++)
1530 endif()
1532 #######################################################################################################################
1533 # install code headers
1535 add_library(carla-headers-backend INTERFACE)
1536 add_library(carla-headers-includes INTERFACE)
1537 add_library(carla-headers-utils INTERFACE)
1539 set_property(TARGET carla-headers-backend
1540   PROPERTY PUBLIC_HEADER
1541     ../source/backend/CarlaBackend.h
1542     ../source/backend/CarlaHost.h
1543     ../source/backend/CarlaUtils.h
1544     ../source/backend/CarlaEngine.hpp
1545     ../source/backend/CarlaPlugin.hpp
1546     ../source/backend/CarlaPluginPtr.hpp
1549 set_property(TARGET carla-headers-includes
1550   PROPERTY PUBLIC_HEADER
1551     ../source/includes/CarlaDefines.h
1552     ../source/includes/CarlaMIDI.h
1553     ../source/includes/CarlaNative.h
1554     ../source/includes/CarlaNativePlugin.h
1557 set_property(TARGET carla-headers-utils
1558   PROPERTY PUBLIC_HEADER
1559     ../source/utils/CarlaBackendUtils.hpp
1560     ../source/utils/CarlaBase64Utils.hpp
1561     ../source/utils/CarlaBinaryUtils.hpp
1562     ../source/utils/CarlaBridgeDefines.hpp
1563     ../source/utils/CarlaBridgeUtils.hpp
1564     ../source/utils/CarlaMacUtils.hpp
1565     ../source/utils/CarlaMathUtils.hpp
1566     ../source/utils/CarlaMemUtils.hpp
1567     ../source/utils/CarlaMutex.hpp
1568     ../source/utils/CarlaRingBuffer.hpp
1569     ../source/utils/CarlaProcessUtils.hpp
1570     ../source/utils/CarlaRunner.hpp
1571     ../source/utils/CarlaScopeUtils.hpp
1572     ../source/utils/CarlaSemUtils.hpp
1573     ../source/utils/CarlaSha1Utils.hpp
1574     ../source/utils/CarlaShmUtils.hpp
1575     ../source/utils/CarlaString.hpp
1576     ../source/utils/CarlaThread.hpp
1577     ../source/utils/CarlaTimeUtils.hpp
1578     ../source/utils/CarlaUtils.hpp
1581 install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
1582 install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
1583 install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
1585 #######################################################################################################################
1586 # pkg-config stuff
1588 if(NOT ${CARLA_BUILD_FRAMEWORKS} AND NOT MSVC)
1589   configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
1590   configure_file(carla-standalone.pc.in carla-standalone.pc @ONLY)
1591   configure_file(carla-native-plugin.pc.in carla-native-plugin.pc @ONLY)
1592   configure_file(carla-host-plugin.pc.in carla-host-plugin.pc @ONLY)
1594   install(FILES
1595     ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
1596     ${CMAKE_CURRENT_BINARY_DIR}/carla-standalone.pc
1597     ${CMAKE_CURRENT_BINARY_DIR}/carla-native-plugin.pc
1598     ${CMAKE_CURRENT_BINARY_DIR}/carla-host-plugin.pc
1599     DESTINATION
1600       ${CMAKE_INSTALL_LIBDIR}/pkgconfig
1601   )
1602 endif()
1604 #######################################################################################################################