-#IF(SQLITE3_LIBRARY)\r
-# TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY})\r
-#ELSE(SQLITE3_LIBRARY)\r
-# MESSAGE(FATAL_ERROR "Could not find SQLite library. You must set the location manually.")\r
-#ENDIF(SQLITE3_LIBRARY)\r
+IF(SQLITE3_LIBRARY)\r
+ TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY})\r
+ELSE(SQLITE3_LIBRARY)\r
+ MESSAGE(STATUS "Could not find system SQLite library. Will compile from included source.")\r
+ ADD_LIBRARY(sqlite3 libs/sqlite3/sqlite3.c)\r
+ TARGET_LINK_LIBRARIES(fms sqlite3)\r
+ADD_LIBRARY(tinyxml libs/tinyxml/tinystr.cpp libs/tinyxml/tinyxml.cpp libs/tinyxml/tinyxmlerror.cpp libs/tinyxml/tinyxmlparser.cpp)\r
+\r
+ENDIF(SQLITE3_LIBRARY)\r