The package knet provides CMake integration:

    find_package(knet CONFIG REQUIRED)
    target_link_libraries(main PRIVATE knet)