-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR) | ||
cmake_policy(SET CMP0091 NEW) | ||
|
||
project(TemplateProject VERSION 1.0.0 LANGUAGES C CXX) | ||
|
||
# Set iPlug2 directory and include iPlug2 CMake files | ||
set(IPLUG2_DIR ${CMAKE_SOURCE_DIR}/../iPlug2) | ||
include(${IPLUG2_DIR}/iPlug2.cmake) | ||
find_package(iPlug2 REQUIRED) | ||
|
||
# Uncomment the following line if you need Skia support | ||
# find_package(iPlug2 REQUIRED COMPONENTS Skia) | ||
|
||
# Set project directories and source files | ||
set(PROJECT_DIR "${CMAKE_SOURCE_DIR}") | ||
set(SRC_FILES | ||
"${PROJECT_DIR}/config.h" | ||
"${PROJECT_DIR}/TemplateProject.h" | ||
"${PROJECT_DIR}/TemplateProject.cpp" | ||
) | ||
source_group(TREE ${PROJECT_DIR} FILES ${SRC_FILES}) | ||
|
||
# Set resource files | ||
set(RESOURCES | ||
"${PROJECT_DIR}/resources/fonts/Roboto-Regular.ttf" | ||
) | ||
|
||
if(APPLE) | ||
# Enable universal binary build for Release builds on macOS | ||
if(CMAKE_BUILD_TYPE STREQUAL "Release") | ||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for macOS" FORCE) | ||
else() | ||
set(CMAKE_OSX_ARCHITECTURES "${CMAKE_HOST_SYSTEM_PROCESSOR}" CACHE STRING "Build architectures for macOS" FORCE) | ||
endif() | ||
# Set Xcode attributes for universal binary build | ||
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Debug] YES) | ||
|
||
# Set Xcode attributes for code signing | ||
# set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM 686EDA2T8T) | ||
# set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application") | ||
# set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE "Manual") | ||
|
||
endif() | ||
|
||
# Create base interface library for common settings | ||
add_library(_base INTERFACE) | ||
iplug_target_add(_base INTERFACE | ||
INCLUDE ${PROJECT_DIR} ${PROJECT_DIR}/resources | ||
# Replace with e.g. iPlug2_Skia_GL2 if you need Skia support | ||
LINK iPlug2_NanoVG_GL2 | ||
FEATURE cxx_std_17 | ||
) | ||
|
||
# APP target configuration | ||
set(TARGET app) | ||
add_executable(${TARGET} WIN32 MACOSX_BUNDLE ${SRC_FILES}) | ||
iplug_target_add(${TARGET} PUBLIC | ||
LINK iPlug2_APP _base | ||
RESOURCE ${RESOURCES} | ||
) | ||
iplug_configure_target(${TARGET} app) | ||
|
||
# CLAP target configuration | ||
set(TARGET clap) | ||
add_library(${TARGET} MODULE ${SRC_FILES}) | ||
iplug_target_add(${TARGET} PUBLIC | ||
LINK iPlug2_CLAP _base | ||
RESOURCE ${RESOURCES} | ||
) | ||
iplug_configure_target(${TARGET} clap) | ||
|
||
# VST2 target configuration | ||
# set(TARGET vst2) | ||
# add_library(${TARGET} MODULE ${SRC_FILES}) | ||
# iplug_target_add(${TARGET} PUBLIC | ||
# LINK iPlug2_VST2 _base | ||
# RESOURCE ${RESOURCES} | ||
# ) | ||
# iplug_configure_target(${TARGET} vst2) | ||
|
||
# VST3 target configuration | ||
set(TARGET vst3) | ||
add_library(${TARGET} MODULE ${SRC_FILES}) | ||
iplug_target_add(${TARGET} PUBLIC | ||
LINK iPlug2_VST3 _base | ||
RESOURCE ${RESOURCES} | ||
) | ||
iplug_configure_target(${TARGET} vst3) | ||
|
||
# AUv2 target configuration (macOS only) | ||
if(APPLE) | ||
set(TARGET auv2) | ||
add_library(${TARGET} MODULE ${SRC_FILES}) | ||
iplug_target_add(${TARGET} PUBLIC | ||
LINK iPlug2_AUv2 _base | ||
RESOURCE ${RESOURCES} | ||
) | ||
iplug_configure_target(${TARGET} auv2) | ||
endif() | ||
|
||
# Windows-specific resource configuration | ||
if(WIN32) | ||
set(CMAKE_RC_FLAGS "/I${PROJECT_DIR}/resources /I${PROJECT_DIR}/resources/fonts /I${PROJECT_DIR}/resources/img ${CMAKE_RC_FLAGS}") | ||
endif() |
Submodule iPlug2
updated
21 files
+1 −0 | .gitattributes | |
+108 −0 | Documentation/cmake.md | |
+104 −0 | Examples/IPlugEffect/CMakeLists.txt | |
+12 −0 | Examples/IPlugEffect/README.md | |
+142 −0 | Examples/IPlugWebUI/CMakeLists.txt | |
+1 −1 | IGraphics/IGraphicsEditorDelegate.h | |
+2 −8 | IGraphics/Platforms/IGraphicsMac_view.mm | |
+3 −1 | IPlug/Extras/WebView/IPlugWebViewEditorDelegate.mm | |
+1 −1 | IPlug/IPlugPluginBase.h | |
+190 −0 | Scripts/cmake/APP.cmake | |
+76 −0 | Scripts/cmake/AUv2.cmake | |
+116 −0 | Scripts/cmake/CLAP.cmake | |
+411 −0 | Scripts/cmake/FindiPlug2.cmake | |
+193 −0 | Scripts/cmake/IGraphics.cmake | |
+239 −0 | Scripts/cmake/LICE.cmake | |
+116 −0 | Scripts/cmake/VST2.cmake | |
+241 −0 | Scripts/cmake/VST3.cmake | |
+35 −0 | Scripts/cmake/WDL.cmake | |
+5 −3 | Scripts/create_bundle.bat | |
+156 −0 | Scripts/postbuild-win.bat.in | |
+42 −0 | iPlug2.cmake |