jackett 0.22.1382
[Homebrew/homebrew-core.git] / Formula / c / cmrc.rb
blob02604cc8d163b57ef51d5850d523041370ec7602
1 class Cmrc < Formula
2   desc "CMake Resource Compiler"
3   homepage "https://github.com/vector-of-bool/cmrc"
4   url "https://github.com/vector-of-bool/cmrc/archive/refs/tags/2.0.1.tar.gz"
5   sha256 "edad5faaa0bea1df124b5e8cb00bf0adbd2faeccecd3b5c146796cbcb8b5b71b"
6   license "MIT"
7   head "https://github.com/vector-of-bool/cmrc.git", branch: "master"
9   bottle do
10     rebuild 1
11     sha256 cellar: :any_skip_relocation, all: "33e1b8facfc9147d12e16f1ea45cb08c26f6e4d9ee5100b298f76a0f01a475ae"
12   end
14   depends_on "cmake" => [:build, :test]
16   def install
17     (share/"cmake").install "CMakeRC.cmake"
18     (share/"CMakeRC/cmake").install_symlink share/"cmake/CMakeRC.cmake" => "CMakeRCConfig.cmake"
19   end
21   test do
22     cmakelists = testpath/"CMakeLists.txt"
23     cmakelists.write <<~CMAKE
24       cmake_minimum_required(VERSION 3.30)
25       include(CMakeRC)
26     CMAKE
27     system "cmake", "-S", ".", "-B", "build1", "-DCMAKE_MODULE_PATH=#{share}/cmake", *std_cmake_args
29     cmakelists.unlink
30     cmakelists.write <<~CMAKE
31       cmake_minimum_required(VERSION 3.30)
32       find_package(CMakeRC CONFIG REQUIRED)
33     CMAKE
35     system "cmake", "-S", ".", "-B", "build2", *std_cmake_args
36   end
37 end