@@ -19,7 +19,7 @@ class Visp < Formula
19
19
sha256 cellar : :any_skip_relocation , x86_64_linux : "5f55415e96b2adca09e489d64b8399f9b14961939f8b0d5b9895ddff1c7f50f9"
20
20
end
21
21
22
- depends_on "cmake" => :build
22
+ depends_on "cmake" => [ :build , :test ]
23
23
depends_on "pkgconf" => [ :build , :test ]
24
24
25
25
depends_on "eigen"
@@ -164,5 +164,19 @@ def install
164
164
pkg_config_flags = shell_output ( "pkgconf --cflags --libs visp" ) . chomp . split
165
165
system ENV . cxx , "test.cpp" , "-o" , "test" , *pkg_config_flags
166
166
assert_equal version . to_s , shell_output ( "./test" ) . chomp
167
+
168
+ ENV . delete "CPATH"
169
+ ( testpath /"CMakeLists.txt" ) . write <<~CMAKE
170
+ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
171
+ project(visp-check)
172
+ find_package(VISP REQUIRED)
173
+ include_directories(${VISP_INCLUDE_DIRS})
174
+ add_executable(visp-check test.cpp)
175
+ target_link_libraries(visp-check ${VISP_LIBRARIES})
176
+ CMAKE
177
+
178
+ system "cmake" , "-B" , "build" , "-S" , "."
179
+ system "cmake" , "--build" , "build"
180
+ assert_equal version . to_s , shell_output ( "build/visp-check" ) . chomp
167
181
end
168
182
end
0 commit comments