]> source.dussan.org Git - tigervnc.git/commitdiff
Handle REQUIRED in our CMake "find" modules
authorPierre Ossman <ossman@cendio.se>
Mon, 17 Apr 2023 13:55:17 +0000 (15:55 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 17 Apr 2023 13:55:17 +0000 (15:55 +0200)
These are expected to abort if they fail to find the relevant software
and "REQUIRED" is specified.

cmake/Modules/FindFfmpeg.cmake
cmake/Modules/FindGmp.cmake
cmake/Modules/FindNettle.cmake
cmake/Modules/FindPixman.cmake

index cf09fa4a714fc2f8de9f426b0a17b354c8ca841e..1a0824494721debc99eca4086c873fe36a41a7bc 100644 (file)
@@ -15,3 +15,8 @@ else()
        find_library(SWSCALE_LIBRARIES NAMES swscale)
        find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIRS)
 endif()
+
+if(Ffmpeg_FIND_REQUIRED AND
+   (NOT AVCODEC_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND))
+       message(FATAL_ERROR "Could not find FFMPEG")
+endif()
index d0ccd3cdf684c85b330de83cdf81627f67dee6aa..8711d68e5de4ac97bd1745c520db5aaacf812822 100644 (file)
@@ -11,3 +11,7 @@ if(NOT GMP_FOUND)
   find_library(GMP_LIBRARIES NAMES gmp)
   find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIRS)
 endif()
+
+if(Gmp_FIND_REQUIRED AND NOT GMP_FOUND)
+       message(FATAL_ERROR "Could not find GMP")
+endif()
index e2283c4966e8459d5b579ee24c360cfe8e3236b7..f5acf6acf37421fd0188165ecf26fbac610a3f4f 100644 (file)
@@ -15,3 +15,7 @@ endif()
 if (NOT HOGWEED_FOUND OR NOT GMP_FOUND)
   set(NETTLE_FOUND 0)
 endif()
+
+if(Nettle_FIND_REQUIRED AND NOT NETTLE_FOUND)
+       message(FATAL_ERROR "Could not find Nettle")
+endif()
index 04fe481f5f3c3a006f12ab110fedf7e98dceb08b..f024b71ad3d4339dc659e5fa21c83c8c6c17002f 100644 (file)
@@ -7,3 +7,7 @@ else()
        find_library(PIXMAN_LIBRARIES NAMES pixman-1)
        find_package_handle_standard_args(PIXMAN DEFAULT_MSG PIXMAN_LIBRARIES PIXMAN_INCLUDE_DIRS)
 endif()
+
+if(Pixman_FIND_REQUIRED AND NOT PIXMAN_FOUND)
+       message(FATAL_ERROR "Could not find Pixman")
+endif()