add_subdirectory(freetype-2.0.9)
add_subdirectory(lua-5.1.3)

# FMOD Ex
set(FMODEX_DIR "./fmodex-4.32.09")
add_library(fmodex SHARED IMPORTED)
if(WHOA_SYSTEM_WIN)
    if(WHOA_ARCH_32)
        include_directories(${FMODEX_DIR}/win32/inc)
        set_target_properties(fmodex PROPERTIES IMPORTED_LOCATION ${FMODEX_DIR}/win32/lib/fmodex_vc.lib)
        install(FILES ${FMODEX_DIR}/win32/lib/fmodex.dll DESTINATION "bin")
    elseif(WHOA_ARCH_64)
        include_directories(${FMODEX_DIR}/win64/inc)
        set_target_properties(fmodex PROPERTIES IMPORTED_LOCATION ${FMODEX_DIR}/win64/lib/fmodex64_vc.lib)
        install(FILES ${FMODEX_DIR}/win64/lib/fmodex64.dll DESTINATION "bin")
    endif()
elseif(WHOA_SYSTEM_LINUX)
    if(WHOA_ARCH_32)
        include_directories(${FMODEX_DIR}/linux32/inc)
        set_target_properties(fmodex PROPERTIES IMPORTED_LOCATION ${FMODEX_DIR}/linux32/lib/libfmodex-4.32.09.so)
        install(FILES ${FMODEX_DIR}/linux32/lib/libfmodex-4.32.09.so DESTINATION "bin")
    elseif(WHOA_ARCH_64)
        include_directories(${FMODEX_DIR}/linux64/inc)
        set_target_properties(fmodex PROPERTIES IMPORTED_LOCATION ${FMODEX_DIR}/linux64/lib/libfmodex-4.32.09.so)
        install(FILES ${FMODEX_DIR}/linux32/lib/libfmodex-4.32.09.so DESTINATION "bin")
    endif()
elseif(WHOA_SYSTEM_MAC)
    # The Mac lib is universal
    include_directories(${FMODEX_DIR}/mac/inc)
    set_target_properties(fmodex PROPERTIES IMPORTED_LOCATION ${FMODEX_DIR}/mac/lib/libfmodex.dylib)
    install(FILES ${FMODEX_DIR}/mac/lib/libfmodex.dylib DESTINATION "bin")
endif()
