Browse Source

CMake: Migrate OpenSSL detection to Package.cmake

Sam Edwards 7 years ago
parent
commit
0b68316b3f
3 changed files with 25 additions and 18 deletions
  1. 0 11
      dtool/Config.cmake
  2. 0 6
      dtool/LocalSetup.cmake
  3. 25 1
      dtool/Package.cmake

+ 0 - 11
dtool/Config.cmake

@@ -487,17 +487,6 @@ without having to reinstall), comment out this definition and put
 your source directory on your PYTHONPATH.")
 your source directory on your PYTHONPATH.")
 
 
 
 
-# Is OpenSSL installed, and where?
-find_package(OpenSSL COMPONENTS ssl crypto QUIET)
-
-package_option(OPENSSL DEFAULT ON
-  "Enable OpenSSL support")
-
-option(REPORT_OPENSSL_ERRORS
-  "Define this true to include the OpenSSL code to report verbose
-error messages when they occur." ${IS_DEBUG_BUILD})
-
-
 # Is libjpeg installed, and where?
 # Is libjpeg installed, and where?
 find_package(JPEG QUIET)
 find_package(JPEG QUIET)
 
 

+ 0 - 6
dtool/LocalSetup.cmake

@@ -190,12 +190,6 @@ endif()
 # Now go through all the packages and report whether we have them.
 # Now go through all the packages and report whether we have them.
 show_packages()
 show_packages()
 
 
-if(HAVE_OPENSSL)
-  message("+ OpenSSL")
-else()
-  message("- Did not find OpenSSL")
-endif()
-
 if(HAVE_JPEG)
 if(HAVE_JPEG)
   message("+ libjpeg")
   message("+ libjpeg")
 else()
 else()

+ 25 - 1
dtool/Package.cmake

@@ -1,8 +1,12 @@
-# Eigen
+#
+# ------------ Eigen ------------
+#
 find_package(Eigen3 QUIET)
 find_package(Eigen3 QUIET)
+
 if(Eigen3_FOUND)
 if(Eigen3_FOUND)
   set(EIGEN_FOUND ON)
   set(EIGEN_FOUND ON)
 endif()
 endif()
+
 package_option(EIGEN
 package_option(EIGEN
   "Enables experimental support for the Eigen linear algebra library.
   "Enables experimental support for the Eigen linear algebra library.
 If this is provided, Panda will use this library as the fundamental
 If this is provided, Panda will use this library as the fundamental
@@ -11,17 +15,37 @@ its own internal implementation.  The primary advantage of using
 Eigen is SSE2 support, which is only activated if LINMATH_ALIGN
 Eigen is SSE2 support, which is only activated if LINMATH_ALIGN
 is also enabled."
 is also enabled."
   LICENSE "MPL-2")
   LICENSE "MPL-2")
+
 option(LINMATH_ALIGN
 option(LINMATH_ALIGN
   "This is required for activating SSE2 support using Eigen.
   "This is required for activating SSE2 support using Eigen.
 Activating this does constrain most objects in Panda to 16-byte
 Activating this does constrain most objects in Panda to 16-byte
 alignment, which could impact memory usage on very-low-memory
 alignment, which could impact memory usage on very-low-memory
 platforms.  Currently experimental." ON)
 platforms.  Currently experimental." ON)
+
 if(LINMATH_ALIGN)
 if(LINMATH_ALIGN)
   config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build")
   config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build")
 else()
 else()
   config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build")
   config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build")
 endif()
 endif()
 
 
+#
+# ------------ OpenSSL ------------
+#
+find_package(OpenSSL COMPONENTS ssl crypto QUIET)
+
+package_option(OPENSSL DEFAULT ON
+  "Enable OpenSSL support")
+
+option(REPORT_OPENSSL_ERRORS
+  "Define this true to include the OpenSSL code to report verbose
+error messages when they occur." ${IS_DEBUG_BUILD})
+
+if(REPORT_OPENSSL_ERRORS)
+  config_package(OPENSSL "OpenSSL" "with verbose error reporting")
+else()
+  config_package(OPENSSL "OpenSSL")
+endif()
+
 # Find and configure Miles Sound System
 # Find and configure Miles Sound System
 find_package(Miles QUIET)
 find_package(Miles QUIET)
 #config_package(RAD_MSS "Miles Sound System")
 #config_package(RAD_MSS "Miles Sound System")