-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move dependencies to CPM for a better offline experience
- Loading branch information
Showing
2 changed files
with
30 additions
and
21 deletions.
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 |
---|---|---|
@@ -1,26 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.24 FATAL_ERROR) | ||
|
||
project(MelatoninPerfetto | ||
VERSION 1.0.0 | ||
VERSION 1.1.0 | ||
LANGUAGES CXX | ||
DESCRIPTION "JUCE module for profiling with Perfetto" | ||
HOMEPAGE_URL "https://github.com/sudara/melatonin_perfetto") | ||
|
||
set(missing_juce_error_message "JUCE must be added to your project before melatonin_perfetto!") | ||
|
||
include(FetchContent) | ||
include(CPM) | ||
|
||
if (MelatoninPerfetto_IS_TOP_LEVEL) | ||
message (STATUS "Cloning JUCE...") | ||
|
||
FetchContent_Declare(JUCE | ||
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git | ||
GIT_TAG origin/master | ||
GIT_SHALLOW TRUE | ||
GIT_PROGRESS TRUE | ||
FIND_PACKAGE_ARGS 7.0.9) | ||
|
||
FetchContent_MakeAvailable(JUCE) | ||
message (STATUS "Grabbing JUCE...") | ||
CPMAddPackage(gh:juce-framework/JUCE@master) | ||
endif () | ||
|
||
if (NOT COMMAND juce_add_module) | ||
|
@@ -33,15 +25,8 @@ set(MP_INSTALL_DEST "${CMAKE_INSTALL_LIBDIR}/cmake/melatonin_perfetto" | |
CACHE STRING | ||
"Path below the install prefix where melatonin_perfetto package files will be installed to") | ||
|
||
message (STATUS "Cloning Perfetto...") | ||
|
||
FetchContent_Declare(Perfetto | ||
GIT_REPOSITORY https://android.googlesource.com/platform/external/perfetto | ||
GIT_TAG v41.0 | ||
GIT_SHALLOW TRUE | ||
GIT_PROGRESS TRUE) | ||
|
||
FetchContent_MakeAvailable(Perfetto) | ||
message (STATUS "Grabbing Perfetto...") | ||
CPMAddPackage(gh:google/[email protected]) | ||
|
||
# we need to manually set up a target for Perfetto | ||
add_library(perfetto STATIC) | ||
|
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,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors | ||
|
||
set(CPM_DOWNLOAD_VERSION 0.40.2) | ||
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d") | ||
|
||
if(CPM_SOURCE_CACHE) | ||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
elseif(DEFINED ENV{CPM_SOURCE_CACHE}) | ||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
else() | ||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
endif() | ||
|
||
# Expand relative path. This is important if the provided path contains a tilde (~) | ||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) | ||
|
||
file(DOWNLOAD | ||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
) | ||
|
||
include(${CPM_DOWNLOAD_LOCATION}) |