Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize rtmidi for conan v2 #9644

Merged
merged 6 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions recipes/rtmidi/4.x.x/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions recipes/rtmidi/4.x.x/conandata.yml

This file was deleted.

93 changes: 0 additions & 93 deletions recipes/rtmidi/4.x.x/conanfile.py

This file was deleted.

10 changes: 0 additions & 10 deletions recipes/rtmidi/4.x.x/test_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/rtmidi/4.x.x/test_package/conanfile.py

This file was deleted.

10 changes: 0 additions & 10 deletions recipes/rtmidi/4.x.x/test_package/test_package.cpp

This file was deleted.

9 changes: 9 additions & 0 deletions recipes/rtmidi/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ sources:
"5.0.0":
url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz"
sha256: "48db0ed58c8c0e207b5d7327a0210b5bcaeb50e26387935d02829239b0f3c2b9"
"4.0.0":
url: "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz"
sha256: "370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd"
patches:
"4.0.0":
- patch_file: "patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch"
base_path: "source_subfolder"
- patch_file: "patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch"
base_path: "source_subfolder"
11 changes: 9 additions & 2 deletions recipes/rtmidi/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from conans import ConanFile, CMake, tools

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.43.0"


class RtMidiConan(ConanFile):
Expand Down Expand Up @@ -75,7 +75,14 @@ def package(self):
tools.rmdir(os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.names["pkg_config"] = "rtmidi"
if tools.Version(self.version) >= "5.0.0":
self.cpp_info.components["librtmidi"].includedirs = [os.path.join("include", "rtmidi")]

self.cpp_info.set_property("cmake_file_name", "RtMidi")
self.cpp_info.set_property("cmake_target_name", "RtMidi::rtmidi")
self.cpp_info.components["librtmidi"].set_property("cmake_target_name", "RtMidi::rtmidi")
self.cpp_info.set_property("pkg_config_name", "rtmidi")
MartinDelille marked this conversation as resolved.
Show resolved Hide resolved
self.cpp_info.components["librtmidi"].set_property("pkg_config_name", "rtmidi")
self.cpp_info.names["cmake_find_package"] = "RtMidi"
self.cpp_info.names["cmake_find_package_multi"] = "RtMidi"
self.cpp_info.components["librtmidi"].names["cmake_find_package"] = "rtmidi"
Expand Down
2 changes: 1 addition & 1 deletion recipes/rtmidi/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>

#include <rtmidi/RtMidi.h>
#include <RtMidi.h>

int main (void) {
std::cout << "Version: " << RtMidi::getVersion() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion recipes/rtmidi/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ versions:
"5.0.0":
folder: "all"
"4.0.0":
folder: "4.x.x"
folder: "all"