I'm glad to hear those are going away... There are a lot of those queries I had to track down.
This is my fix for perl on FreeBSD. I'm pretty sure that's all I needed. I know I didn't change the headers, and I couldn't seem to find a version that it worked without that.
Code:
IF(UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ADD_DEFINITIONS(-DFREEBSD)
+ ADD_DEFINITIONS(-Wno-reserved-user-defined-literal)
SET(FREEBSD TRUE)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ENDIF(UNIX)