Work on FreeBSD CMake port. From https://github.com/Adwelean/Adwelean-Server/commit/699de1fd285cc97705b403840caf23d54f018789
Thanks @Adwelean

Signed-off-by: Kevin <kevainxxx@gmail.com>