use find_library() instead LINK_DIRECTORIES() and check_library_exists().