2020-02-27 22:34:29 +01:00
|
|
|
include (GNUInstallDirs)
|
2020-02-01 16:11:11 +01:00
|
|
|
|
2020-02-13 11:50:04 +01:00
|
|
|
add_subdirectory(external/kiss_fft)
|
|
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
set (SFIZZ_SOURCES
|
2019-11-23 18:31:14 +01:00
|
|
|
sfizz/Synth.cpp
|
|
|
|
|
sfizz/FilePool.cpp
|
2020-02-08 12:09:19 +01:00
|
|
|
sfizz/FilterPool.cpp
|
2020-02-09 18:17:15 +01:00
|
|
|
sfizz/EQPool.cpp
|
2019-11-23 18:31:14 +01:00
|
|
|
sfizz/Region.cpp
|
|
|
|
|
sfizz/Voice.cpp
|
|
|
|
|
sfizz/ScopedFTZ.cpp
|
2019-12-15 02:20:46 +01:00
|
|
|
sfizz/MidiState.cpp
|
2019-11-23 18:31:14 +01:00
|
|
|
sfizz/SfzHelpers.cpp
|
2019-12-22 23:36:34 +01:00
|
|
|
sfizz/Oversampler.cpp
|
2019-11-23 18:31:14 +01:00
|
|
|
sfizz/FloatEnvelopes.cpp
|
2020-01-12 09:55:44 +01:00
|
|
|
sfizz/Logger.cpp
|
2020-01-30 18:54:58 +01:00
|
|
|
sfizz/SfzFilter.cpp
|
2020-03-03 13:11:31 +01:00
|
|
|
sfizz/Curve.cpp
|
2020-02-13 14:39:28 +01:00
|
|
|
sfizz/Wavetables.cpp
|
2020-02-26 21:09:34 +01:00
|
|
|
sfizz/Effects.cpp
|
|
|
|
|
sfizz/effects/Nothing.cpp
|
2020-03-12 14:27:39 +01:00
|
|
|
sfizz/effects/Filter.cpp
|
2020-03-12 14:49:31 +01:00
|
|
|
sfizz/effects/Eq.cpp
|
2020-03-08 18:35:27 +01:00
|
|
|
sfizz/effects/Apan.cpp
|
2020-02-26 21:09:34 +01:00
|
|
|
sfizz/effects/Lofi.cpp
|
2020-03-18 15:29:01 +01:00
|
|
|
sfizz/effects/Limiter.cpp
|
2020-03-30 13:59:18 +02:00
|
|
|
sfizz/effects/Strings.cpp
|
2020-03-18 01:53:47 +01:00
|
|
|
sfizz/effects/Rectify.cpp
|
2020-03-18 20:02:15 +01:00
|
|
|
sfizz/effects/Gain.cpp
|
2020-03-18 20:49:52 +01:00
|
|
|
sfizz/effects/Width.cpp
|
2019-11-23 18:31:14 +01:00
|
|
|
)
|
2020-02-10 00:48:34 +01:00
|
|
|
include (SfizzSIMDSourceFiles)
|
2019-11-25 16:10:30 +01:00
|
|
|
|
|
|
|
|
# Parser core library
|
|
|
|
|
add_library (sfizz_parser STATIC)
|
2020-03-17 18:37:20 +01:00
|
|
|
target_sources (sfizz_parser PRIVATE
|
|
|
|
|
sfizz/Parser.cpp sfizz/Opcode.cpp sfizz/SfzHelpers.cpp
|
|
|
|
|
sfizz/parser/Parser.cpp sfizz/parser/ParserPrivate.cpp)
|
2019-11-25 16:10:30 +01:00
|
|
|
target_include_directories (sfizz_parser PUBLIC sfizz)
|
|
|
|
|
target_include_directories (sfizz_parser PUBLIC external)
|
2020-03-17 18:37:20 +01:00
|
|
|
target_link_libraries (sfizz_parser PUBLIC absl::strings PRIVATE absl::flat_hash_map)
|
2019-11-25 16:10:30 +01:00
|
|
|
|
2020-01-19 00:37:56 +01:00
|
|
|
# Sfizz static library
|
2020-01-19 00:22:16 +01:00
|
|
|
add_library(sfizz_static STATIC)
|
2020-03-04 20:02:24 +01:00
|
|
|
target_sources(sfizz_static PRIVATE ${SFIZZ_SOURCES} sfizz/sfizz_wrapper.cpp sfizz/sfizz.cpp)
|
2020-01-19 00:22:16 +01:00
|
|
|
target_include_directories (sfizz_static PUBLIC .)
|
2020-01-19 00:37:56 +01:00
|
|
|
target_include_directories (sfizz_static PUBLIC external)
|
|
|
|
|
target_link_libraries (sfizz_static PUBLIC absl::strings absl::span)
|
2020-02-13 11:50:04 +01:00
|
|
|
target_link_libraries (sfizz_static PRIVATE sfizz_parser absl::flat_hash_map Threads::Threads sfizz-sndfile sfizz-pugixml sfizz-spline sfizz-kissfft)
|
2020-02-27 22:34:29 +01:00
|
|
|
set_target_properties (sfizz_static PROPERTIES OUTPUT_NAME sfizz PUBLIC_HEADER "sfizz.h;sfizz.hpp")
|
2020-02-14 03:28:09 +01:00
|
|
|
if (WIN32)
|
|
|
|
|
target_compile_definitions (sfizz_static PRIVATE _USE_MATH_DEFINES)
|
|
|
|
|
endif()
|
2020-02-27 22:34:29 +01:00
|
|
|
|
2020-02-28 09:00:38 +01:00
|
|
|
if (NOT MSVC)
|
|
|
|
|
install (TARGETS sfizz_static
|
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
2020-02-28 21:01:12 +01:00
|
|
|
|
|
|
|
|
configure_file (${PROJECT_SOURCE_DIR}/scripts/sfizz.pc.in sfizz.pc @ONLY)
|
2020-03-14 09:53:15 +01:00
|
|
|
install (FILES ${CMAKE_BINARY_DIR}/src/sfizz.pc
|
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
2020-03-06 19:55:36 +01:00
|
|
|
endif()
|
|
|
|
|
if(WIN32)
|
|
|
|
|
include(VSTConfig)
|
2020-02-28 21:01:12 +01:00
|
|
|
configure_file (${PROJECT_SOURCE_DIR}/scripts/innosetup.iss.in ${PROJECT_BINARY_DIR}/innosetup.iss @ONLY)
|
2020-02-28 09:00:38 +01:00
|
|
|
endif()
|
2019-11-23 18:31:14 +01:00
|
|
|
|
2020-03-09 00:25:35 +01:00
|
|
|
configure_file (${PROJECT_SOURCE_DIR}/doxygen/scripts/Doxyfile.in ${PROJECT_SOURCE_DIR}/Doxyfile @ONLY)
|
2020-03-08 15:29:08 +01:00
|
|
|
|
2019-11-25 16:10:30 +01:00
|
|
|
add_library (sfizz::parser ALIAS sfizz_parser)
|
2020-01-19 00:22:16 +01:00
|
|
|
add_library (sfizz::sfizz ALIAS sfizz_static)
|
2020-03-07 14:18:47 +01:00
|
|
|
if (LIBATOMIC_FOUND)
|
|
|
|
|
target_link_libraries (sfizz_static PRIVATE atomic)
|
2020-01-24 10:30:31 +01:00
|
|
|
endif()
|
2019-11-23 18:31:14 +01:00
|
|
|
|
|
|
|
|
# Shared library and installation target
|
2019-11-23 19:10:37 +01:00
|
|
|
if (SFIZZ_SHARED)
|
2020-01-18 17:32:30 +01:00
|
|
|
add_library (sfizz_shared SHARED)
|
2020-01-23 22:17:06 +01:00
|
|
|
target_sources(sfizz_shared PRIVATE ${SFIZZ_SOURCES} sfizz/sfizz_wrapper.cpp sfizz/sfizz.cpp)
|
2020-01-18 17:32:30 +01:00
|
|
|
target_include_directories (sfizz_shared PRIVATE .)
|
2020-02-27 23:04:23 +01:00
|
|
|
target_include_directories (sfizz_shared PRIVATE external)
|
2020-02-13 11:50:04 +01:00
|
|
|
target_link_libraries (sfizz_shared PRIVATE absl::strings absl::span sfizz_parser absl::flat_hash_map Threads::Threads sfizz-sndfile sfizz-pugixml sfizz-spline sfizz-kissfft)
|
2020-02-14 03:28:09 +01:00
|
|
|
if (WIN32)
|
|
|
|
|
target_compile_definitions (sfizz_shared PRIVATE _USE_MATH_DEFINES)
|
|
|
|
|
endif()
|
2020-01-19 00:22:16 +01:00
|
|
|
target_compile_definitions(sfizz_shared PRIVATE SFIZZ_EXPORT_SYMBOLS)
|
2020-03-26 23:12:41 +01:00
|
|
|
set_target_properties (sfizz_shared PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} OUTPUT_NAME sfizz)
|
2020-01-18 17:32:30 +01:00
|
|
|
sfizz_enable_lto_if_needed(sfizz_shared)
|
2020-02-27 22:34:29 +01:00
|
|
|
|
2020-02-28 09:00:38 +01:00
|
|
|
if (NOT MSVC)
|
|
|
|
|
install (TARGETS sfizz_shared
|
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2020-03-14 09:52:41 +01:00
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2020-02-28 09:00:38 +01:00
|
|
|
endif()
|
2020-01-24 10:30:31 +01:00
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
2020-02-01 16:11:11 +01:00
|
|
|
if (LIBATOMIC_FOUND)
|
|
|
|
|
target_link_libraries (sfizz_shared PRIVATE atomic)
|
|
|
|
|
endif()
|
2020-01-24 10:30:31 +01:00
|
|
|
endif()
|
2019-11-25 16:11:39 +01:00
|
|
|
endif()
|