diff --git a/recipes/rtmidi/4.x.x/CMakeLists.txt b/recipes/rtmidi/4.x.x/CMakeLists.txt deleted file mode 100644 index 217b9530b904d..0000000000000 --- a/recipes/rtmidi/4.x.x/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/rtmidi/4.x.x/conandata.yml b/recipes/rtmidi/4.x.x/conandata.yml deleted file mode 100644 index fa3820692cac5..0000000000000 --- a/recipes/rtmidi/4.x.x/conandata.yml +++ /dev/null @@ -1,10 +0,0 @@ -sources: - "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" diff --git a/recipes/rtmidi/4.x.x/conanfile.py b/recipes/rtmidi/4.x.x/conanfile.py deleted file mode 100644 index 1889ce4321d37..0000000000000 --- a/recipes/rtmidi/4.x.x/conanfile.py +++ /dev/null @@ -1,93 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - -required_conan_version = ">=1.33.0" - - -class RtMidiConan(ConanFile): - name = "rtmidi" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.music.mcgill.ca/~gary/rtmidi/" - description = "Realtime MIDI input/output" - topics = ("midi") - license = "MIT+send-patches-upstream" - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "pkg_config" - exports_sources = "CMakeLists.txt", "patches/*" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _with_alsa(self): - return self.settings.os == "Linux" - - def config_options(self): - if self.settings.os == 'Windows': - del self.options.fPIC - - def configure(self): - if self.options.shared: - del self.options.fPIC - - def requirements(self): - if self._with_alsa: - self.requires("libalsa/1.2.4") - - def build_requirements(self): - if self._with_alsa: - self.build_requires("pkgconf/1.7.4") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["RTMIDI_BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - - def package_info(self): - self.cpp_info.names["pkg_config"] = "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" - self.cpp_info.components["librtmidi"].names["cmake_find_package_multi"] = "rtmidi" - self.cpp_info.components["librtmidi"].libs = ["rtmidi"] - if self._with_alsa: - self.cpp_info.components["librtmidi"].requires.append("libalsa::libalsa") - if self.settings.os == "Macos": - self.cpp_info.components["librtmidi"].frameworks.extend( - ["CoreFoundation", "CoreAudio", "CoreMidi"] - ) - if self.settings.os == "Windows": - self.cpp_info.components["librtmidi"].system_libs.append("winmm") - elif self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["librtmidi"].system_libs.append("pthread") diff --git a/recipes/rtmidi/4.x.x/test_package/CMakeLists.txt b/recipes/rtmidi/4.x.x/test_package/CMakeLists.txt deleted file mode 100644 index 3c27c5d636b66..0000000000000 --- a/recipes/rtmidi/4.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(RtMidi REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} RtMidi::rtmidi) diff --git a/recipes/rtmidi/4.x.x/test_package/conanfile.py b/recipes/rtmidi/4.x.x/test_package/conanfile.py deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/rtmidi/4.x.x/test_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/rtmidi/4.x.x/test_package/test_package.cpp b/recipes/rtmidi/4.x.x/test_package/test_package.cpp deleted file mode 100644 index da0f751760d9a..0000000000000 --- a/recipes/rtmidi/4.x.x/test_package/test_package.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main (void) { - try { - RtMidiOut *midiout = new RtMidiOut(); - delete midiout; - } catch ( RtMidiError &error ) { - error.printMessage(); - } -} diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml index 6e8c986c6d33d..75f25b7e567a0 100644 --- a/recipes/rtmidi/all/conandata.yml +++ b/recipes/rtmidi/all/conandata.yml @@ -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" diff --git a/recipes/rtmidi/all/conanfile.py b/recipes/rtmidi/all/conanfile.py index 1889ce4321d37..dddecdb71bc7b 100644 --- a/recipes/rtmidi/all/conanfile.py +++ b/recipes/rtmidi/all/conanfile.py @@ -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): @@ -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") + 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" diff --git a/recipes/rtmidi/4.x.x/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch b/recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch similarity index 100% rename from recipes/rtmidi/4.x.x/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch rename to recipes/rtmidi/all/patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch diff --git a/recipes/rtmidi/4.x.x/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch b/recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch similarity index 100% rename from recipes/rtmidi/4.x.x/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch rename to recipes/rtmidi/all/patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch diff --git a/recipes/rtmidi/all/test_package/test_package.cpp b/recipes/rtmidi/all/test_package/test_package.cpp index 905abb58a752a..2f70ea6b37d15 100644 --- a/recipes/rtmidi/all/test_package/test_package.cpp +++ b/recipes/rtmidi/all/test_package/test_package.cpp @@ -1,6 +1,6 @@ #include -#include +#include int main (void) { std::cout << "Version: " << RtMidi::getVersion() << std::endl; diff --git a/recipes/rtmidi/config.yml b/recipes/rtmidi/config.yml index 9fbd40c0171ce..30e9497f54064 100644 --- a/recipes/rtmidi/config.yml +++ b/recipes/rtmidi/config.yml @@ -2,4 +2,4 @@ versions: "5.0.0": folder: "all" "4.0.0": - folder: "4.x.x" + folder: "all"