-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
51 lines (41 loc) · 1.7 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
# Mandatory line, sets the minimum version of CMake that should be used with this repository.
# I specified 3.22 because I trust it. However, currently I have 3.26 installed on my machine.
# To verify your version run
# $ cmake --version
cmake_minimum_required(VERSION 3.22)
# Sets a few variables, like PROJECT_NAME
project(WolfSoundAudioPluginTemplate)
# Always use the newest C++ standard on green-field projects if possible.
# Currently, JUCE supports only C++ 20 cross-platform.
set(CMAKE_CXX_STANDARD 20)
# I like to download the dependencies to the same folder as the project.
# If you want to install them system wide, set CPM_SOURCE_CACHE with the path to the dependencies
# either as an environment variable or pass it to the cmake script with -DCPM_SOURCE_CACHE=<path>.
set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs)
# Downloads CPM if not already downloaded. CPM is an easy-to-use package manager nicely integrated with CMake.
include(cmake/cpm.cmake)
# This commands downloads AND configures JUCE. It sets up some variables, like JUCE_SOURCE_DIR.
CPMAddPackage(
NAME JUCE
GIT_TAG 8.0.0
VERSION 8.0.0
GITHUB_REPOSITORY juce-framework/JUCE
SOURCE_DIR ${LIB_DIR}/juce
)
# Adds googletest.
CPMAddPackage(
NAME GOOGLETEST
GITHUB_REPOSITORY google/googletest
GIT_TAG v1.14.0
VERSION 1.14.0
SOURCE_DIR ${LIB_DIR}/googletest
OPTIONS
"INSTALL_GTEST OFF"
"gtest_force_shared_crt ON"
)
# This command allows running tests from the "build" folder (the one where CMake generates the project to).
enable_testing()
# Adds all the targets configured in the "plugin" folder.
add_subdirectory(plugin)
# Adds all the targets configured in the "test" folder.
add_subdirectory(test)