<commit_before>PROJECT(dabbad C)

FIND_PACKAGE(Doxygen)
FIND_PACKAGE(Setcap REQUIRED)
FIND_PACKAGE(NL REQUIRED)
INCLUDE(Pod2Man)

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

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

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

ADD_EXECUTABLE(${PROJECT_NAME} dabbad.c interface.c ipc.c help.c capture.c misc.c thread.c)

TARGET_LINK_LIBRARIES (${PROJECT_NAME} libdabba libdabba-rpc ${CMAKE_THREAD_LIBS_INIT} ${NL_LIBRARIES})

POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/dabbad.c dabbad 8)

INSTALL(FILES ${DABBAD_HDRS} DESTINATION include/dabbad COMPONENT headers)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION sbin COMPONENT applications)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${SETCAP_EXECUTABLE} cap_net_raw,cap_ipc_lock,cap_net_admin=eip ${CMAKE_INSTALL_PREFIX}/sbin/${PROJECT_NAME})")

ADD_CUSTOM_TARGET(${PROJECT_NAME}-setcap COMMAND ${SETCAP_EXECUTABLE} cap_sys_nice,cap_net_raw,cap_ipc_lock,cap_net_admin=eip ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
ADD_DEPENDENCIES(setcap ${PROJECT_NAME}-setcap)<commit_msg>cmake: add rpc.c to file list to compile.<commit_after>PROJECT(dabbad C)

FIND_PACKAGE(Doxygen)
FIND_PACKAGE(Setcap REQUIRED)
FIND_PACKAGE(NL REQUIRED)
INCLUDE(Pod2Man)

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

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

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

ADD_EXECUTABLE(${PROJECT_NAME} dabbad.c interface.c ipc.c rpc.c help.c capture.c misc.c thread.c)

TARGET_LINK_LIBRARIES (${PROJECT_NAME} libdabba libdabba-rpc ${CMAKE_THREAD_LIBS_INIT} ${NL_LIBRARIES})

POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/dabbad.c dabbad 8)

INSTALL(FILES ${DABBAD_HDRS} DESTINATION include/dabbad COMPONENT headers)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION sbin COMPONENT applications)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${SETCAP_EXECUTABLE} cap_net_raw,cap_ipc_lock,cap_net_admin=eip ${CMAKE_INSTALL_PREFIX}/sbin/${PROJECT_NAME})")

ADD_CUSTOM_TARGET(${PROJECT_NAME}-setcap COMMAND ${SETCAP_EXECUTABLE} cap_sys_nice,cap_net_raw,cap_ipc_lock,cap_net_admin=eip ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
ADD_DEPENDENCIES(setcap ${PROJECT_NAME}-setcap)
{'fraction_non_alphanumeric': 0.1177257525083612, 'fraction_numerical': 0.002006688963210702, 'mean_word_length': 9.53169014084507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5963961', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1201, 'n_words': 141}