diff --git a/.gitignore b/.gitignore index 4bafb64..b994a25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# OS's +.DS_Store + # Prerequisites *.d @@ -52,6 +55,9 @@ compile_commands.json # IntelliJ IDEA .idea +# Qt Creator +*.txt.user + # CMake common patterns build*/ cmake-build*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a2fb3d..6185667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.24) cmake_policy(SET CMP0091 NEW) # use CMAKE_MSVC_RUNTIME_LIBRARY cmake_policy(SET CMP0100 NEW) # handle .hh files cmake_policy(SET CMP0110 NEW) # arbitrary test name -enable_testing() - set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) project(CLAP_EXAMPLES C CXX) @@ -13,11 +11,10 @@ set(UsePkgConfig TRUE CACHE BOOL "Use PkgConfig to find RtMidi and RtAudio depen set(CLAP_HOST_BUNDLE FALSE CACHE BOOL "Produce a macOS bundle") set(CLAP_HOST_BINARY clap-host CACHE STRING "File name of the resulting binary") +include(cmake/Dependencies.cmake) + set(CMAKE_AUTOMOC ON) -#find_package(Qt6 COMPONENTS Widgets REQUIRED) -find_package(Qt6Core CONFIG REQUIRED) -find_package(Qt6Widgets CONFIG REQUIRED) if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang|Clang|GNU") add_compile_options(-fvisibility=hidden -fvisibility-inlines-hidden @@ -29,9 +26,9 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang|Clang") add_compile_options(-Wmost -Wsuper-class-method-mismatch) endif() -add_subdirectory(clap EXCLUDE_FROM_ALL) -add_subdirectory(clap-helpers EXCLUDE_FROM_ALL) - +#find_package(Qt6 COMPONENTS Widgets REQUIRED) +find_package(Qt6Core CONFIG REQUIRED) +find_package(Qt6Widgets CONFIG REQUIRED) if(UsePkgConfig) find_package(PkgConfig REQUIRED) pkg_check_modules(RtMidi REQUIRED IMPORTED_TARGET rtmidi) @@ -40,6 +37,8 @@ else() find_package(RtMidi CONFIG REQUIRED) find_package(RtAudio CONFIG REQUIRED) endif() +find_package(clap CONFIG REQUIRED) +find_package(clap-helpers CONFIG REQUIRED) add_subdirectory(host) diff --git a/clap b/clap deleted file mode 160000 index df8f16c..0000000 --- a/clap +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df8f16c69ba1c1a15fb105f0c5a2e5b9ac6be742 diff --git a/clap-helpers b/clap-helpers deleted file mode 160000 index 0a5d34d..0000000 --- a/clap-helpers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a5d34d689952d7ec3feac088bff354943ee2d6c diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake new file mode 100644 index 0000000..4968f74 --- /dev/null +++ b/cmake/Dependencies.cmake @@ -0,0 +1,22 @@ +include(FetchContent) + +FetchContent_Declare( + clap + GIT_REPOSITORY https://github.com/free-audio/clap.git + GIT_TAG 1.2.0 + SYSTEM + # 'FIND_PACKAGE_ARGS' will skip download if + # the target is already available in the system + FIND_PACKAGE_ARGS NAMES clap +) + +FetchContent_Declare( + clap-helpers + GIT_REPOSITORY https://github.com/free-audio/clap-helpers.git + GIT_TAG main + SYSTEM + FIND_PACKAGE_ARGS NAMES clap-helpers +) + + +FetchContent_MakeAvailable(clap clap-helpers) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 5f4987a..6bf3687 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -19,7 +19,6 @@ add_executable(clap-host plugin-quick-controls-widget.cc plugin-quick-controls-widget.hh - CMakeLists.txt device-reference.hh engine.cc engine.hh