From 51291a9fd6d1486ea317dfeb2cc2e1b9699c5881 Mon Sep 17 00:00:00 2001 From: Jim Binder Date: Wed, 14 Nov 2012 00:08:57 +0100 Subject: [PATCH] cmake: fix libnl issue --- src/cmake/modules/FindLibnl.cmake | 24 +++++++++++++++++------- src/netsniff-ng/CMakeLists.txt | 1 + src/trafgen/CMakeLists.txt | 1 + 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/cmake/modules/FindLibnl.cmake b/src/cmake/modules/FindLibnl.cmake index 6ee0fdf4..ede0b7c2 100644 --- a/src/cmake/modules/FindLibnl.cmake +++ b/src/cmake/modules/FindLibnl.cmake @@ -10,9 +10,14 @@ # LIBNL_LIBRARIES - the libnl library # LIBNL_INCLUDE_DIR - the include path of the libnl library -find_library(LIBNL_LIBRARY nl-genl-3) +find_library(LIBNL_LIBRARY nl-3) +find_library(LIBNL_GENL_LIBRARY nl-genl-3) -set(LIBNL_LIBRARIES ${LIBNL_LIBRARY}) +message(STATUS LIBNL_LIBRARY=${LIBNL_LIBRARY}) +message(STATUS LIBNL_GENL_LIBRARY=${LIBNL_GENL_LIBRARY}) + +set(LIBNL_LIBRARIES ${LIBNL_LIBRARY}) +set(LIBNL_GENL_LIBRARIES ${LIBNL_GENL_LIBRARY}) find_path( LIBNL_INCLUDE_DIR @@ -20,15 +25,20 @@ find_path( PATH_SUFFIXES include/libnl3 ) +include_directories(AFTER ${LIBNL_INCLUDE_DIR}) +message(STATUS LIBNL_INCLUDE_DIR2=${LIBNL_INCLUDE_DIR}) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - Libnl DEFAULT_MSG - LIBNL_LIBRARY - LIBNL_INCLUDE_DIR + Libnl DEFAULT_MSG + LIBNL_LIBRARY + LIBNL_INCLUDE_DIR ) mark_as_advanced( - LIBNL_INCLUDE_DIR - LIBNL_LIBRARY + LIBNL_INCLUDE_DIR + LIBNL_LIBRARY ) + + diff --git a/src/netsniff-ng/CMakeLists.txt b/src/netsniff-ng/CMakeLists.txt index cc229d0f..05da4a3a 100644 --- a/src/netsniff-ng/CMakeLists.txt +++ b/src/netsniff-ng/CMakeLists.txt @@ -73,6 +73,7 @@ if(CMAKE_HAVE_PTHREAD_CREATE AND LIBNL_FOUND) ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} ${LIBNL_LIBRARIES} + ${LIBNL_GENL_LIBRARIES} ) pod2man( diff --git a/src/trafgen/CMakeLists.txt b/src/trafgen/CMakeLists.txt index 8463a8ee..4044f103 100644 --- a/src/trafgen/CMakeLists.txt +++ b/src/trafgen/CMakeLists.txt @@ -46,6 +46,7 @@ if(FLEX_FOUND AND BISON_FOUND AND LIBNL_FOUND) target_link_libraries( ${PROJECT_NAME} ${LIBNL_LIBRARIES} + ${LIBNL_GENL_LIBRARY} ) pod2man( -- 2.11.4.GIT