Browse Source

CMake: Migrate JPEG/PNG/TIFF discovery to Package.cmake

Sam Edwards 7 years ago
parent
commit
68cb953479
3 changed files with 19 additions and 42 deletions
  1. 0 24
      dtool/Config.cmake
  2. 0 18
      dtool/LocalSetup.cmake
  3. 19 0
      dtool/Package.cmake

+ 0 - 24
dtool/Config.cmake

@@ -487,34 +487,10 @@ without having to reinstall), comment out this definition and put
 your source directory on your PYTHONPATH.")
 
 
-# Is libjpeg installed, and where?
-find_package(JPEG QUIET)
-
-package_option(JPEG DEFAULT ON
-  "Enable support for loading .jpg images.")
-
-# Some versions of libjpeg did not provide jpegint.h.  Redefine this
-# to false if you lack this header file.
-#set(PHAVE_JPEGINT_H TRUE)
-
 option(HAVE_VIDEO4LINUX
   "Set this to enable webcam support on Linux." ${IS_LINUX})
 
 
-# Is libpng installed, and where?
-find_package(PNG QUIET)
-
-package_option(PNG DEFAULT ON
-  "Enable support for loading .png images.")
-
-
-# Is libtiff installed, and where?
-find_package(TIFF QUIET)
-
-package_option(TIFF
-  "Enable support for loading .tif images.")
-
-
 # Is libtar installed, and where?
 find_package(Tar QUIET)
 

+ 0 - 18
dtool/LocalSetup.cmake

@@ -190,24 +190,6 @@ endif()
 # Now go through all the packages and report whether we have them.
 show_packages()
 
-if(HAVE_JPEG)
-  message("+ libjpeg")
-else()
-  message("- Did not find libjpeg")
-endif()
-
-if(HAVE_PNG)
-  message("+ libpng")
-else()
-  message("- Did not find libpng")
-endif()
-
-if(HAVE_TIFF)
-  message("+ libtiff")
-else()
-  message("- Did not find libtiff")
-endif()
-
 if(HAVE_TAR)
   message("+ libtar")
 else()

+ 19 - 0
dtool/Package.cmake

@@ -46,6 +46,25 @@ else()
   config_package(OPENSSL "OpenSSL")
 endif()
 
+#
+# ------------ IMAGE FORMATS ------------
+#
+
+# JPEG:
+find_package(JPEG QUIET)
+package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.")
+config_package(JPEG "libjpeg")
+
+# PNG:
+find_package(PNG QUIET)
+package_option(PNG DEFAULT ON "Enable support for loading .png images.")
+config_package(PNG "libpng")
+
+# TIFF:
+find_package(TIFF QUIET)
+package_option(TIFF "Enable support for loading .tif images.")
+config_package(TIFF "libtiff")
+
 # Find and configure Miles Sound System
 find_package(Miles QUIET)
 #config_package(RAD_MSS "Miles Sound System")