+FIND_LIBRARY(ICONV_LIBRARY NAMES iconv iconv_s libiconv libiconv_s)\r
+IF(ALTERNATE_CAPTCHA)\r
+ FIND_FILE(FREEIMAGE_LIBRARY NAMES libfreeimage.a PATHS /usr/lib/)\r
+ IF(NOT FREEIMAGE_LIBRARY)\r
+ FIND_LIBRARY(FREEIMAGE_LIBRARY NAMES FreeImage libFreeImage libfreeimage freeimage)\r
+ ENDIF(NOT FREEIMAGE_LIBRARY)\r
+ENDIF(ALTERNATE_CAPTCHA)\r
+\r
+IF(POCO_FOUNDATION_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${POCO_FOUNDATION_LIBRARY})\r
+ ADD_DEFINITIONS(-DPOCO_HAVE_IPv6)\r
+ IF(WIN32)\r
+ ADD_DEFINITIONS(-DPOCO_STATIC)\r
+ ENDIF(WIN32)\r
+ IF(POCO_UTIL_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${POCO_UTIL_LIBRARY})\r
+ ELSE(POCO_UTIL_LIBRARY)\r
+ MESSAGE(FATAL_ERROR "Could not find system Poco Util library. You must set the location manually.")\r
+ ENDIF(POCO_UTIL_LIBRARY)\r
+ IF(POCO_NET_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${POCO_NET_LIBRARY})\r
+ ELSE(POCO_NET_LIBRARY)\r
+ MESSAGE(FATAL_ERROR "Could not find system Poco Net library. You must set the location manually.")\r
+ ENDIF(POCO_NET_LIBRARY)\r
+ IF(POCO_XML_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${POCO_XML_LIBRARY})\r
+ ELSE(POCO_XML_LIBRARY)\r
+ MESSAGE(FATAL_ERROR "Could not find system Poco XML library. You must set the location manually.")\r
+ ENDIF(POCO_XML_LIBRARY)\r
+ELSE(POCO_FOUNDATION_LIBRARY)\r
+ MESSAGE(FATAL_ERROR "Could not find system Poco Foundation library. You must set the location manually.")\r
+ENDIF(POCO_FOUNDATION_LIBRARY)\r
+\r
+IF(NOT WIN32)\r
+ IF(PTHREADS_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${PTHREADS_LIBRARY})\r
+ ELSE(PTHREADS_LIBRARY)\r
+ MESSAGE(FATAL_ERROR "Could not find system pthread library. You must set the location manually.")\r
+ ENDIF(PTHREADS_LIBRARY)\r
+ENDIF(NOT WIN32)\r