Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't depend on submodules for clap and clap-helpers #38

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# OS's
.DS_Store
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are all over the place on macOS, hope you don't mind

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't mind.
Though in the best practice, you could add those to your personal gitignore (global git config).


# Prerequisites
*.d

Expand Down Expand Up @@ -52,6 +55,9 @@ compile_commands.json
# IntelliJ IDEA
.idea

# Qt Creator
*.txt.user

# CMake common patterns
build*/
cmake-build*/
Expand Down
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.24)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for the behavior that I want in FetchContent, I'll explain on another comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.24 is OK, it is quite old already.

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)
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanted to get all the compiler flag stuff before all the find_package stuff


add_subdirectory(host)

Expand Down
1 change: 0 additions & 1 deletion clap
Submodule clap deleted from df8f16
1 change: 0 additions & 1 deletion clap-helpers
Submodule clap-helpers deleted from 0a5d34
22 changes: 22 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down