andre@1160: # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@1160: # Software engineering by Intevation GmbH andre@1160: # andre@1160: # This file is Free Software under the GNU GPL (v>=2) andre@1160: # and comes with ABSOLUTELY NO WARRANTY! andre@1160: # See LICENSE.txt for details. wilde@224: # - Try to find Mozilla NSS wilde@224: wilde@224: include(FindPkgConfig) wilde@224: pkg_check_modules (NSS nss) wilde@224: wilde@224: if (NOT NSS_FOUND) wilde@224: set(NSS_INCLUDES nss.h nspr.h) wilde@224: set(NSS_LIBS nss3 nssutil3 smime3 ssl3 plds4 plc4 nspr4) wilde@224: wilde@224: foreach(include ${NSS_INCLUDES}) wilde@224: wilde@224: find_path(NSS_${include}_INCLUDE ${include} andre@345: HINTS ${NSS_INCLUDEDIR} andre@345: ${NSS_INCLUDEDIR}/nspr) wilde@224: wilde@224: if(NSS_${include}_INCLUDE) wilde@224: set(NSS_INCLUDE_DIRS ${NSS_INCLUDE_DIRS};${NSS_${include}_INCLUDE}) wilde@224: else(NSS_${include}_INCLUDE) wilde@224: message(STATUS "Could not find NSS include: ${include}") wilde@224: return() wilde@224: endif(NSS_${include}_INCLUDE) wilde@224: wilde@224: endforeach(include) wilde@224: wilde@224: foreach(lib ${NSS_LIBS}) wilde@224: wilde@224: find_library(NSS_${lib}_LIBRARIE ${lib} wilde@224: HINTS ${NSS_LIBDIR}) wilde@224: wilde@224: if(NSS_${lib}_LIBRARIE) wilde@224: set(NSS_LIBRARIES ${NSS_LIBRARIES};${NSS_${lib}_LIBRARIE}) wilde@224: else(NSS_${lib}_LIBRARIE) wilde@224: message(STATUS "Could not find NSS library: ${lib}") wilde@224: return() wilde@224: endif(NSS_${lib}_LIBRARIE) wilde@224: wilde@224: endforeach(lib) wilde@224: wilde@224: include(FindPackageHandleStandardArgs) wilde@224: wilde@224: find_package_handle_standard_args(NSS wilde@224: REQUIRED_VARS NSS_INCLUDE_DIRS NSS_LIBRARIES wilde@224: ) wilde@224: endif (NOT NSS_FOUND)