summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindNSS.cmake
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-24 02:27:47 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-26 11:43:54 -0500
commit621d9e5c413e561293d7484b93882d985b3fe15f (patch)
tree638f3d75761c121d9a8fb50b52a12a6686c5ac5c /cmake/Modules/FindNSS.cmake
parent40d3643b8d91886bf210aa27f711731c81a11e49 (diff)
downloadpki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131
Diffstat (limited to 'cmake/Modules/FindNSS.cmake')
-rw-r--r--cmake/Modules/FindNSS.cmake121
1 files changed, 121 insertions, 0 deletions
diff --git a/cmake/Modules/FindNSS.cmake b/cmake/Modules/FindNSS.cmake
new file mode 100644
index 000000000..9b89c08a2
--- /dev/null
+++ b/cmake/Modules/FindNSS.cmake
@@ -0,0 +1,121 @@
+# - Try to find NSS
+# Once done this will define
+#
+# NSS_FOUND - system has NSS
+# NSS_INCLUDE_DIRS - the NSS include directory
+# NSS_LIBRARIES - Link these to use NSS
+# NSS_DEFINITIONS - Compiler switches required for using NSS
+#
+# Copyright (c) 2010 Andreas Schneider <asn@redhat.com>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (NSS_LIBRARIES AND NSS_INCLUDE_DIRS)
+ # in cache already
+ set(NSS_FOUND TRUE)
+else (NSS_LIBRARIES AND NSS_INCLUDE_DIRS)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_NSS nss)
+ endif (PKG_CONFIG_FOUND)
+
+ find_path(NSS_INCLUDE_DIR
+ NAMES
+ nss.h
+ PATHS
+ ${_NSS_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ PATH_SUFFIXES
+ nss3
+ )
+
+ find_library(SSL3_LIBRARY
+ NAMES
+ ssl3
+ PATHS
+ ${_NSS_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ find_library(SMIME3_LIBRARY
+ NAMES
+ smime3
+ PATHS
+ ${_NSS_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ find_library(NSS3_LIBRARY
+ NAMES
+ nss3
+ PATHS
+ ${_NSS_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ find_library(NSSUTIL3_LIBRARY
+ NAMES
+ nssutil3
+ PATHS
+ ${_NSS_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ set(NSS_INCLUDE_DIRS
+ ${NSS_INCLUDE_DIR}
+ )
+
+ if (SSL3_LIBRARY)
+ set(NSS_LIBRARIES
+ ${NSS_LIBRARIES}
+ ${SSL3_LIBRARY}
+ )
+ endif (SSL3_LIBRARY)
+
+ if (SMIME3_LIBRARY)
+ set(NSS_LIBRARIES
+ ${NSS_LIBRARIES}
+ ${SMIME3_LIBRARY}
+ )
+ endif (SMIME3_LIBRARY)
+
+ if (NSS3_LIBRARY)
+ set(NSS_LIBRARIES
+ ${NSS_LIBRARIES}
+ ${NSS3_LIBRARY}
+ )
+ endif (NSS3_LIBRARY)
+
+ if (NSSUTIL3_LIBRARY)
+ set(NSS_LIBRARIES
+ ${NSS_LIBRARIES}
+ ${NSSUTIL3_LIBRARY}
+ )
+ endif (NSSUTIL3_LIBRARY)
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(NSS DEFAULT_MSG NSS_LIBRARIES NSS_INCLUDE_DIRS)
+
+ # show the NSS_INCLUDE_DIRS and NSS_LIBRARIES variables only in the advanced view
+ mark_as_advanced(NSS_INCLUDE_DIRS NSS_LIBRARIES)
+
+endif (NSS_LIBRARIES AND NSS_INCLUDE_DIRS)