summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-04-04 21:09:10 +0000
committerGuy Harris <guy@alum.mit.edu>2013-04-04 21:09:10 +0000
commit9bd43d3c28e4457c527d7de89bdf2b73290344ae (patch)
tree466dbea4a1481aa5f36f0de9181cf8d67784d2fd /cmake
parent5312d37e93f470ca2fa241ad2242f1af8ae34587 (diff)
downloadwireshark-9bd43d3c28e4457c527d7de89bdf2b73290344ae.tar.gz
If we somehow manage to find libnl version 2 or 3, but don't manage to
find the corresponding libnl-genl or libnl-route libraries, act as if we didn't find libnl. If we didn't find libnl version 2 or 3, don't check whether it's version 2 or 3. svn path=/trunk/; revision=48742
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindNL.cmake23
1 files changed, 16 insertions, 7 deletions
diff --git a/cmake/modules/FindNL.cmake b/cmake/modules/FindNL.cmake
index f84097e9c1..77f0f87b8d 100644
--- a/cmake/modules/FindNL.cmake
+++ b/cmake/modules/FindNL.cmake
@@ -3,7 +3,7 @@
#
# Find the native netlink includes and library
#
-# If they exist, differentiate between versions 1,2 and 3.
+# If they exist, differentiate between versions 1, 2 and 3.
# Version 1 does not have netlink/version.h
# Version 3 does have the major version number as a suffix
# to the libnl name (libnl-3)
@@ -56,12 +56,21 @@ ELSE (NL_LIBRARIES AND NL_INCLUDE_DIRS )
PATHS
$(SEARCHPATHS)
)
- STRING(REGEX REPLACE ".*nl-([^.,;]*).*" "\\1" NLSUFFIX ${NL_LIBRARY})
- IF ( NLSUFFIX )
- SET( HAVE_LIBNL3 1 )
- ELSE ( NLSUFFIX )
- SET( HAVE_LIBNL2 1 )
- ENDIF (NLSUFFIX )
+ #
+ # If we don't have all of those libraries, we can't use libnl.
+ #
+ IF ( NOT NLGENL_LIBRARY AND NOT NLROUTE_LIBRARY )
+ SET( NL_LIBRARY NOTFOUND )
+ ENDIF ( NOT NLGENL_LIBRARY AND NOT NLROUTE_LIBRARY )
+ IF( NL_LIBRARY )
+ STRING(REGEX REPLACE ".*nl-([^.,;]*).*" "\\1" NLSUFFIX ${NL_LIBRARY})
+ IF ( NLSUFFIX )
+ SET( HAVE_LIBNL3 1 )
+ ELSE ( NLSUFFIX )
+ SET( HAVE_LIBNL2 1 )
+ ENDIF (NLSUFFIX )
+ SET( HAVE_LIBNL 1 )
+ ENDIF( NL_LIBRARY )
ELSE( NL_INCLUDE_DIR )
# NL version 1 ?
FIND_PATH( NL_INCLUDE_DIR