More optional system preinstalled dependencies
Catch2, ghc-filesystem, lv2 headers and VST3SDK sources preinstalled system packages can be used, optionally and where available, to build sfizz via CMake options: SFIZZ_USE_SYSTEM_CATCH SFIZZ_USE_SYSTEM_GHC_FS SFIZZ_USE_SYSTEM_LV2 SFIZZ_USE_SYSTEM_VST3SDK
This commit is contained in:
parent
795af9c68b
commit
4c819222a0
115 changed files with 79 additions and 8 deletions
|
|
@ -37,10 +37,14 @@ option_ex (SFIZZ_SHARED "Enable shared library build" ON)
|
|||
option_ex (SFIZZ_USE_SNDFILE "Enable use of the sndfile library" OFF)
|
||||
option_ex (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_ABSEIL "Use Abseil libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_GHC_FS "Use GHC Filesystem libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_SIMDE "Use SIMDe libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_KISS_FFT "Use KISS FFT libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_PUGIXML "Use pugixml libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_CXXOPTS "Use CXXOPTS libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_LV2 "Use LV2 headers preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_VST3SDK "Use VST3SDK source files preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_USE_SYSTEM_CATCH "Use Catch libraries preinstalled on system" OFF)
|
||||
option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF)
|
||||
option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
|
||||
option_ex (SFIZZ_PROFILE_BUILD "Profile the build time" OFF)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ include(CheckCXXCompilerFlag)
|
|||
include(CheckCXXSourceCompiles)
|
||||
include(GNUWarnings)
|
||||
|
||||
# FIXME: The current Abseil LTS version requires at least C++14, see
|
||||
# https://github.com/abseil/abseil-cpp/releases/tag/20230125.1
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to be used")
|
||||
set(CMAKE_C_STANDARD 99 CACHE STRING "C standard to be used")
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@ endif()
|
|||
# Add Abseil
|
||||
if(SFIZZ_USE_SYSTEM_ABSEIL)
|
||||
find_package(absl REQUIRED)
|
||||
# Workaround for silent Abseil module, see #1117
|
||||
if(absl_FOUND)
|
||||
message(STATUS "Found system Abseil libraries, version ${absl_VERSION}")
|
||||
endif()
|
||||
else()
|
||||
function(sfizz_add_vendor_abseil)
|
||||
set(BUILD_SHARED_LIBS OFF) # only changed at local scope
|
||||
|
|
@ -71,6 +75,8 @@ if(SFIZZ_USE_SYSTEM_CXXOPTS)
|
|||
find_path(CXXOPTS_INCLUDE_DIR "cxxopts.hpp")
|
||||
if(NOT CXXOPTS_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "Cannot find cxxopts")
|
||||
else()
|
||||
message(STATUS "Found system cxxopts")
|
||||
endif()
|
||||
add_library(sfizz_cxxopts INTERFACE)
|
||||
target_include_directories(sfizz_cxxopts INTERFACE "${CXXOPTS_INCLUDE_DIR}")
|
||||
|
|
@ -241,9 +247,20 @@ if(FALSE)
|
|||
target_include_directories(sfizz_filesystem INTERFACE "external/filesystem/include")
|
||||
else()
|
||||
# static library
|
||||
if(SFIZZ_USE_SYSTEM_GHC_FS)
|
||||
find_path(GHC_INCLUDE_DIR "ghc/fs_std.hpp")
|
||||
if(NOT GHC_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "Cannot find ghc-filesystem")
|
||||
else()
|
||||
message(STATUS "Found system ghc-filesystem")
|
||||
endif()
|
||||
set(SFIZZ_FILESYSTEM_INCLUDE_DIR "${GHC_INCLUDE_DIR}")
|
||||
else()
|
||||
set(SFIZZ_FILESYSTEM_INCLUDE_DIR "external/filesystem/include")
|
||||
endif()
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/fs_std_impl.cpp" "#include <ghc/fs_std_impl.hpp>")
|
||||
add_library(sfizz_filesystem_impl STATIC "${CMAKE_CURRENT_BINARY_DIR}/fs_std_impl.cpp")
|
||||
target_include_directories(sfizz_filesystem_impl PUBLIC "external/filesystem/include")
|
||||
target_include_directories(sfizz_filesystem_impl PUBLIC ${SFIZZ_FILESYSTEM_INCLUDE_DIR})
|
||||
# Add the needed linker option for GCC 8
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU"
|
||||
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
set(VSTGUI_BASEDIR "${CMAKE_CURRENT_SOURCE_DIR}/external/vstgui4")
|
||||
if(SFIZZ_USE_SYSTEM_VST3SDK)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(VST3SDK "vst3sdk" REQUIRED)
|
||||
set(VSTGUI_BASEDIR "${VST3SDK_INCLUDE_DIRS}/vstgui4")
|
||||
else()
|
||||
set(VSTGUI_BASEDIR "${CMAKE_CURRENT_SOURCE_DIR}/external/vstgui4")
|
||||
endif()
|
||||
|
||||
include("cmake/Vstgui.cmake")
|
||||
|
||||
set(EDITOR_RESOURCES
|
||||
|
|
|
|||
|
|
@ -11,9 +11,21 @@
|
|||
#include "utility/vstgui_after.h"
|
||||
#include <string>
|
||||
|
||||
#define VSTGUI_MORE_THAN_4_10 ((VSTGUI_VERSION_MAJOR > 4) \
|
||||
|| (VSTGUI_VERSION_MAJOR == 4 && VSTGUI_VERSION_MINOR > 10))
|
||||
|
||||
#if VSTGUI_MORE_THAN_4_10
|
||||
#define OVERRIDE override
|
||||
// FIXME: Use KeyboardEvent instead
|
||||
#define IKEYBOARDHOOK OldKeyboardHookAdapter
|
||||
#else
|
||||
#define OVERRIDE
|
||||
#define IKEYBOARDHOOK IKeyboardHook
|
||||
#endif
|
||||
|
||||
using namespace VSTGUI;
|
||||
|
||||
class SAboutDialog : public CViewContainer, public IControlListener, public IKeyboardHook{
|
||||
class SAboutDialog : public CViewContainer, public IControlListener, public IKEYBOARDHOOK {
|
||||
|
||||
enum {
|
||||
kTagButtonSfztools,
|
||||
|
|
@ -28,8 +40,8 @@ public:
|
|||
|
||||
void setPluginFormat(const std::string& pluginFormat);
|
||||
void setPluginHost(const std::string& pluginHost);
|
||||
int32_t onKeyDown (const VstKeyCode& code, CFrame* frame) override;
|
||||
int32_t onKeyUp (const VstKeyCode& code, CFrame* frame) override;
|
||||
int32_t onKeyDown(const VstKeyCode& code, CFrame* frame) OVERRIDE;
|
||||
int32_t onKeyUp(const VstKeyCode& code, CFrame* frame) OVERRIDE;
|
||||
|
||||
protected:
|
||||
CMouseEventResult onMouseDown(CPoint& where, const CButtonState& buttons) override;
|
||||
|
|
|
|||
|
|
@ -50,13 +50,28 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
# target_link_libraries(${LV2PLUGIN_PRJ_NAME}_ui "-Wl,-u,lv2ui_descriptor")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(${LV2PLUGIN_PRJ_NAME} PRIVATE . external/ardour)
|
||||
if(SFIZZ_USE_SYSTEM_LV2)
|
||||
find_path(LV2_INCLUDE_DIR "lv2.h")
|
||||
if(NOT LV2_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "Cannot find lv2 include directory")
|
||||
else()
|
||||
message(STATUS "Found system lv2")
|
||||
endif()
|
||||
else()
|
||||
target_include_directories(${LV2PLUGIN_PRJ_NAME} PRIVATE vendor)
|
||||
endif()
|
||||
sfizz_enable_lto_if_needed(${LV2PLUGIN_PRJ_NAME})
|
||||
if(MINGW)
|
||||
set_target_properties(${LV2PLUGIN_PRJ_NAME} PROPERTIES LINK_FLAGS "-static")
|
||||
endif()
|
||||
|
||||
if(SFIZZ_LV2_UI)
|
||||
target_include_directories(${LV2PLUGIN_PRJ_NAME}_ui PRIVATE . external/ardour)
|
||||
if(NOT SFIZZ_USE_SYSTEM_LV2)
|
||||
target_include_directories(${LV2PLUGIN_PRJ_NAME}_ui PRIVATE vendor)
|
||||
endif()
|
||||
sfizz_enable_lto_if_needed(${LV2PLUGIN_PRJ_NAME}_ui)
|
||||
if(MINGW)
|
||||
set_target_properties(${LV2PLUGIN_PRJ_NAME}_ui PROPERTIES LINK_FLAGS "-static")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#ifndef _ardour_lv2_extensions_h_
|
||||
#define _ardour_lv2_extensions_h_
|
||||
|
||||
#include "lv2/core/lv2.h"
|
||||
#include <lv2/core/lv2.h>
|
||||
|
||||
/**
|
||||
@defgroup lv2inlinedisplay Inline-Display
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue