PROJECT(dabbacore C)

FILE(GLOB DABBACORE_HDRS ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/include/${PROJECT_NAME}/*.h)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/include)

ADD_SUBDIRECTORY(tests)

IF(DOXYGEN_FOUND)
	CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
	ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(DOXYGEN_FOUND)

ADD_LIBRARY(${PROJECT_NAME} packet_mmap.c nic.c strlcpy.c)

TARGET_LINK_LIBRARIES(${PROJECT_NAME})

INSTALL(FILES ${DABBACORE_HDRS} DESTINATION /usr/local/include/${PROJECT_NAME})
INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION /usr/lib)

PROJECT(dabbacore C)

FILE(GLOB DABBACORE_HDRS ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/include/${PROJECT_NAME}/*.h)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/include)

ADD_SUBDIRECTORY(tests)

IF(DOXYGEN_FOUND)
	CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
	ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(DOXYGEN_FOUND)

ADD_LIBRARY(${PROJECT_NAME} SHARED packet_mmap.c nic.c strlcpy.c)

TARGET_LINK_LIBRARIES(${PROJECT_NAME})

INSTALL(FILES ${DABBACORE_HDRS} DESTINATION /usr/local/include/${PROJECT_NAME})
INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION /usr/lib)

Build core library as shared library.
Build core library as shared library.
