cmake_minimum_required(VERSION 2.8.3) project(L3ROAMD C) INCLUDE(FindPkgConfig) IF(NOT PKG_CONFIG_FOUND) MESSAGE(FATAL_ERROR "Error: pkg-config not found on this system") ENDIF(NOT PKG_CONFIG_FOUND) MESSAGE(STATUS "") MESSAGE(STATUS "Configuring libnl ...") PKG_SEARCH_MODULE(LIBNL-TINY libnl-tiny) IF(LIBNL-TINY_FOUND) INCLUDE_DIRECTORIES(${LIBNL-TINY_INCLUDE_DIRS}) LINK_DIRECTORIES(${LIBNL-TINY_LIBRARY_DIRS}) SET(LIBNL_LIBRARIES ${LIBNL-TINY_LIBRARIES}) ELSE(LIBNL-TINY_FOUND) PKG_SEARCH_MODULE(LIBNL libnl>=2.0 libnl-2.0 libnl-2) IF(LIBNL_FOUND) INCLUDE_DIRECTORIES(${LIBNL_INCLUDE_DIRS}) LINK_DIRECTORIES(${LIBNL_LIB_DIRS}) LIST(APPEND LIBNL_LIBRARIES nl-genl ) ELSE(LIBNL_FOUND) PKG_SEARCH_MODULE(LIBNL3 libnl-3 libnl-3.0 libnl-3.1) IF(LIBNL3_FOUND) INCLUDE_DIRECTORIES(${LIBNL3_INCLUDE_DIRS}) LINK_DIRECTORIES(${LIBNL3_LIB_DIRS}) SET(LIBNL_LIBRARIES ${LIBNL3_LIBRARIES}) ############################################################# MESSAGE(STATUS "") MESSAGE(STATUS "Configuring libnl-genl ...") PKG_SEARCH_MODULE(LIBNL_GENL libnl-genl>=2.0 libnl-genl-3 libnl-genl-3.0 libnl-genl-3.1) IF(LIBNL_GENL_FOUND) INCLUDE_DIRECTORIES(${LIBNL_GENL_INCLUDE_DIRS}) LINK_DIRECTORIES(${LIBNL_GENL_LIB_DIRS}) ELSEIF(LIBNL_GENL_FOUND) MESSAGE(FATAL_ERROR "Error: libnl-genl not found") ENDIF(LIBNL_GENL_FOUND) ELSE(LIBNL3_FOUND) MESSAGE(FATAL_ERROR "Error: libnl and libnl-genl not found") ENDIF(LIBNL3_FOUND) ENDIF(LIBNL_FOUND) ENDIF(LIBNL-TINY_FOUND) set(CMAKE_MODULE_PATH ${L3ROAMD_SOURCE_DIR}) add_subdirectory(src)