-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
54 lines (47 loc) · 1.92 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.15)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "Build for 10.1")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT CMAKE_BUILD_TYPE)
message(FATAL_ERROR "You need to specify CMAKE_BUILD_TYPE")
endif()
project(anira-clap-plugin-example VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
FetchContent_Declare(clap
GIT_REPOSITORY https://github.com/free-audio/clap.git
GIT_TAG main
GIT_PROGRESS TRUE
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(clap)
FetchContent_Declare(clap-helpers
GIT_REPOSITORY https://github.com/free-audio/clap-helpers.git
GIT_TAG main
GIT_PROGRESS TRUE
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(clap-helpers)
add_library(${PROJECT_NAME} MODULE
anira-clap-demo.cpp
anira-clap-demo-pluginentry.cpp
utils/DryWetMixer.cpp
)
target_link_libraries(${PROJECT_NAME} clap-core clap-helpers anira)
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
BUNDLE True
BUNDLE_EXTENSION clap
MACOSX_BUNDLE_GUI_IDENTIFIER org.anira-project.${PROJECT_NAME}
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION "0.1"
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.1"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/cmake/anira-clap-demo.plist.in
)
target_link_libraries(${PROJECT_NAME} "-framework CoreFoundation" "-framework AppKit" "-framework CoreGraphics")
target_compile_definitions(${PROJECT_NAME} PRIVATE IS_MAC=1)
elseif(UNIX)
target_compile_definitions(${PROJECT_NAME} PRIVATE IS_LINUX=1)
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".clap" PREFIX "")
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE IS_WIN=1)
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".clap" PREFIX "")
endif()