X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8c6fa3fbaccc22127280bf77a48fab5a3ee0716e..46b0747592074017ff0ea4b33d4a7194235886e5:/cmake/modules/FindMNL.cmake diff --git a/cmake/modules/FindMNL.cmake b/cmake/modules/FindMNL.cmake new file mode 100644 index 00000000..833f1bcd --- /dev/null +++ b/cmake/modules/FindMNL.cmake @@ -0,0 +1,22 @@ +find_path ( MNL_INCLUDE_DIR NAMES libmnl/libmnl.h DOC "Path to MNL header files." ) +mark_as_advanced ( MNL_INCLUDE_DIR ) + +find_library ( MNL_LIB NAMES mnl DOC "Location of MNL library." ) +mark_as_advanced ( MNL_LIB ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( MNL + REQUIRED_VARS MNL_LIB MNL_INCLUDE_DIR + VERSION_VAR MNL_VERSION ) + +# Create the imported target +if ( MNL_FOUND ) + set ( MNL_INCLUDE_DIRS ${MNL_INCLUDE_DIR} ) + set ( MNL_LIBRARIES ${MNL_LIB} ) + if ( NOT TARGET MNL::MNL ) + add_library ( MNL::MNL UNKNOWN IMPORTED ) + set_target_properties ( MNL::MNL PROPERTIES + IMPORTED_LOCATION "${MNL_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${MNL_INCLUDE_DIR}" ) + endif ( NOT TARGET MNL::MNL ) +endif ( MNL_FOUND )