commit 3b26744708bbef1e55760b250dd5973741159dab
parent 057923abf46987391281be404e2f1369f642f2a6
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 12 Jan 2020 15:03:20 -0500
download the REAPER SDK and make WDL a submodule
Diffstat:
6 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/.appveyor.yml b/.appveyor.yml
@@ -2,9 +2,7 @@
version: "{build}-{branch}"
before_build:
- - curl -fsSL https://github.com/reaper-oss/sws/raw/master/reaper/reaper_plugin.h -o vendor/reaper_plugin.h
- - curl -fsSL https://gist.github.com/cfillion/da355e8278048de08ae065d6fe6031c1/raw/reaper_plugin_functions.h -o vendor/reaper_plugin_functions.h
- - git clone -q --depth 1 https://github.com/justinfrankel/WDL.git vendor/WDL
+ - git submodule update --init
test_script:
- cmake --build build --target test
diff --git a/.gitmodules b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "vendor/WDL"]
+ path = vendor/WDL
+ url = https://github.com/justinfrankel/WDL.git
diff --git a/.travis.yml b/.travis.yml
@@ -5,10 +5,6 @@ osx_image: xcode9.4 # macOS 10.13
env:
- ARCH=x86_64
- ARCH=i386
-install:
- - wget -nv https://github.com/reaper-oss/sws/raw/master/reaper/reaper_plugin.h -P vendor
- - wget -nv https://gist.github.com/cfillion/da355e8278048de08ae065d6fe6031c1/raw/reaper_plugin_functions.h -P vendor
- - git clone -q --depth 1 https://github.com/justinfrankel/WDL.git vendor/WDL
script:
- cmake -B build
-DCMAKE_BUILD_TYPE=Release
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -36,24 +36,29 @@ endif()
STRING(TOLOWER "${ARCH_NAME}" ARCH_NAME)
-if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vendor/reaper_plugin.h")
- message(FATAL_ERROR
- "reaper_plugin.h cannot be found in ${CMAKE_CURRENT_SOURCE_DIR}/vendor.\n"
+function(fetch fn url alt)
+ set(path "${CMAKE_CURRENT_SOURCE_DIR}/${fn}")
- "The latest version can be downloaded from Landoleet: "
- "https://landoleet.org/dev/reaper_plugin.h"
- )
-endif()
+ if(EXISTS "${path}")
+ return()
+ endif()
-if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vendor/reaper_plugin_functions.h")
- message(FATAL_ERROR
- "reaper_plugin_functions.h cannot be found in "
- "${CMAKE_CURRENT_SOURCE_DIR}/vendor.\n"
+ message(STATUS "Downloading ${fn} from ${url} into vendor...")
+ file(DOWNLOAD ${url} "${path}" STATUS status LOG log)
+ list(GET status 0 status_code)
- "Generate it using the following REAPER action: "
- "[developer] Write C++ API functions header."
- )
-endif()
+ if(NOT status_code EQUAL 0)
+ file(REMOVE "${path}")
+ message(SEND_ERROR "Failed to download ${fn}.\n${alt}")
+ endif()
+endfunction()
+
+fetch(vendor/reaper_plugin.h https://landoleet.org/dev/reaper_plugin.h
+ "Download the latest version from Landoleet manually.")
+fetch(vendor/reaper_plugin_functions.h
+ https://gist.github.com/cfillion/da355e8278048de08ae065d6fe6031c1/raw/reaper_plugin_functions.h
+ "Generate it using this REAPER action: [developer] Write C++ API functions header."
+)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/README.md b/README.md
@@ -17,13 +17,8 @@ Software requirements:
- C++17 compiler (MSVC on Windows)
- PHP (Linux and macOS only)
-Put the REAPER extension SDK into the `vendor` directory:
-
-- [reaper_plugin.h](https://landoleet.org/dev/reaper_plugin.h)
-- reaper_plugin_functions.h from the REAPER action
- "[developer] Write C++ API functions header"
-
-Clone [WDL](http://www.cockos.com/wdl/): `git clone https://github.com/justinfrankel/WDL.git vendor/WDL`
+Clone the repository and submodules:
+`git clone --recursive https://github.com/cfillion/reapack.git`.
#### Linux
diff --git a/vendor/WDL b/vendor/WDL
@@ -0,0 +1 @@
+Subproject commit d0410ef5d7f9df9daf1e1b4620cff4d180f382ba