comparison cmake/FindNSS.cmake @ 224:689b94dd89a9

Wrote FindNSS to build against nss without pkg-config support (Windows).
author Sascha Wilde <wilde@intevation.de>
date Thu, 27 Mar 2014 17:00:01 +0100
parents
children fe86c45755d8
comparison
equal deleted inserted replaced
223:d29997e09177 224:689b94dd89a9
1 # - Try to find Mozilla NSS
2
3 include(FindPkgConfig)
4 # FIXME: maybe a minimal version would be wise...
5 pkg_check_modules (NSS nss)
6
7 if (NOT NSS_FOUND)
8 set(NSS_INCLUDES nss.h nspr.h)
9 set(NSS_LIBS nss3 nssutil3 smime3 ssl3 plds4 plc4 nspr4)
10
11 foreach(include ${NSS_INCLUDES})
12
13 find_path(NSS_${include}_INCLUDE ${include}
14 HINTS ${NSS_INCLUDEDIR})
15
16 if(NSS_${include}_INCLUDE)
17 set(NSS_INCLUDE_DIRS ${NSS_INCLUDE_DIRS};${NSS_${include}_INCLUDE})
18 else(NSS_${include}_INCLUDE)
19 message(STATUS "Could not find NSS include: ${include}")
20 return()
21 endif(NSS_${include}_INCLUDE)
22
23 endforeach(include)
24
25 foreach(lib ${NSS_LIBS})
26
27 find_library(NSS_${lib}_LIBRARIE ${lib}
28 HINTS ${NSS_LIBDIR})
29
30 if(NSS_${lib}_LIBRARIE)
31 set(NSS_LIBRARIES ${NSS_LIBRARIES};${NSS_${lib}_LIBRARIE})
32 else(NSS_${lib}_LIBRARIE)
33 message(STATUS "Could not find NSS library: ${lib}")
34 return()
35 endif(NSS_${lib}_LIBRARIE)
36
37 endforeach(lib)
38
39 include(FindPackageHandleStandardArgs)
40
41 find_package_handle_standard_args(NSS
42 REQUIRED_VARS NSS_INCLUDE_DIRS NSS_LIBRARIES
43 )
44 endif (NOT NSS_FOUND)

http://wald.intevation.org/projects/trustbridge/