option(DAO_MODULES_STRING_FORMAT "Build the \"format\" module which adds string formatting to Dao." ON)
if(DAO_MODULES_STRING_FORMAT)
    add_library(dao_format SHARED format/dao_format.c)
    target_link_libraries(dao_format ${DAOLIB_TO_LINK})
    install(TARGETS dao_format DESTINATION "${DAO_MODULES_INSTALL_DIR}/string")
endif(DAO_MODULES_STRING_FORMAT)

option(DAO_MODULES_STRING_MD5 "Build the \"md5\" module which adds the MD5 algorithm to Dao." ON)
if(DAO_MODULES_STRING_MD5)
    add_library(dao_md5 SHARED md5/dao_md5.c md5/dao_md5.h)
    target_link_libraries(dao_md5 ${DAOLIB_TO_LINK})
    install(TARGETS dao_md5 DESTINATION "${DAO_MODULES_INSTALL_DIR}/string")
endif(DAO_MODULES_STRING_MD5)

option(DAO_MODULES_STRING_TOKENIZE "Build the \"tokenize\" module which adds string tokenizing to Dao." ON)
if(DAO_MODULES_STRING_TOKENIZE)
    add_library(dao_tokenize SHARED tokenize/dao_tokenize.c)
    target_link_libraries(dao_tokenize ${DAOLIB_TO_LINK})
    install(TARGETS dao_tokenize DESTINATION "${DAO_MODULES_INSTALL_DIR}/string")
endif(DAO_MODULES_STRING_TOKENIZE)

option(DAO_MODULES_STRING_CRYPTO "Build the \"xxtea\" module which adds XXTEA string de-/encryption to Dao." ON)
if(DAO_MODULES_STRING_CRYPTO)
    add_library(dao_xxtea SHARED xxtea/dao_xxtea.c xxtea/dao_xxtea.h)
    target_link_libraries(dao_xxtea ${DAOLIB_TO_LINK})
    install(TARGETS dao_xxtea DESTINATION "${DAO_MODULES_INSTALL_DIR}/string")
endif(DAO_MODULES_STRING_CRYPTO)

# Also add the "string" module containing all of these.
if(DAO_MODULES_STRING_FORMAT OR DAO_MODULES_STRING_MD5 OR DAO_MODULES_STRING_TOKENIZE OR DAO_MODULES_STRING_CRYPTO)
    install(FILES "string.dao" DESTINATION "${DAO_MODULES_INSTALL_DIR}/string")
endif()
