set_property(GLOBAL PROPERTY USE_FOLDERS ON)

MESSAGE("UNIX: ${UNIX}")
MESSAGE("ANDROID: ${ANDROID}")
MESSAGE("APPLE: ${APPLE}")
MESSAGE("MINGW: ${MINGW}")
MESSAGE("MSVC: ${MSVC}")

SET(HUMMINGBIRD_REPOSITORY ${CMAKE_CURRENT_SOURCE_DIR}/../..)
SET(HUMMINGBIRD_DEPENDENCIES_SOURCE_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies)
SET(HUMMINGBIRD_SOURCE_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/src)
SET(HUMMINGBIRD_DEPENDENCIES_TEMP_DIRECTORY ${CMAKE_BINARY_DIR}/solutions)

IF(NOT HUMMINGBIRD_INSTALL_PATH)
    SET(HUMMINGBIRD_INSTALL_PATH ${HUMMINGBIRD_REPOSITORY}/bin)
ENDIF()

MESSAGE("HUMMINGBIRD_REPOSITORY: ${HUMMINGBIRD_REPOSITORY}")
MESSAGE("HUMMINGBIRD_DEPENDENCIES_SOURCE_DIRECTORY: ${HUMMINGBIRD_DEPENDENCIES_SOURCE_DIRECTORY}")
MESSAGE("HUMMINGBIRD_SOURCE_DIRECTORY: ${HUMMINGBIRD_SOURCE_DIRECTORY}")
MESSAGE("HUMMINGBIRD_DEPENDENCIES_TEMP_DIRECTORY: ${HUMMINGBIRD_DEPENDENCIES_TEMP_DIRECTORY}")
MESSAGE("HUMMINGBIRD_INSTALL_PATH: ${HUMMINGBIRD_INSTALL_PATH}")

SET(HUMMINGBIRD_TARGET_UNIX OFF)
SET(HUMMINGBIRD_TARGET_ANDROID OFF)
SET(HUMMINGBIRD_TARGET_OSX OFF)
SET(HUMMINGBIRD_TARGET_MINGW OFF)
SET(HUMMINGBIRD_TARGET_WIN32 OFF)

if(UNIX AND NOT ANDROID AND NOT APPLE)
    SET(HUMMINGBIRD_TARGET_UNIX ON)
elseif(ANDROID)
    SET(HUMMINGBIRD_TARGET_ANDROID ON)
elseif(APPLE AND NOT IOS)
    SET(HUMMINGBIRD_TARGET_OSX ON)
elseif(MINGW)
    SET(HUMMINGBIRD_TARGET_MINGW ON)
elseif(WIN32)
    SET(HUMMINGBIRD_TARGET_WIN32 ON)
else()
    MESSAGE(FATAL_ERROR "unsuppot platform")
endif()

MESSAGE("HUMMINGBIRD_TARGET_UNIX: ${HUMMINGBIRD_TARGET_UNIX}")
MESSAGE("HUMMINGBIRD_TARGET_ANDROID: ${HUMMINGBIRD_TARGET_ANDROID}")
MESSAGE("HUMMINGBIRD_TARGET_OSX: ${HUMMINGBIRD_TARGET_OSX}")
MESSAGE("HUMMINGBIRD_TARGET_MINGW: ${HUMMINGBIRD_TARGET_MINGW}")
MESSAGE("HUMMINGBIRD_TARGET_WIN32: ${HUMMINGBIRD_TARGET_WIN32}")

# input and thirdparty paths
if(HUMMINGBIRD_TARGET_UNIX)
    SET(HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/lib/dependencies/${CMAKE_GENERATOR})
    SET(HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
    SET(HUMMINGBIRD_CONFIGURATION_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies/configuration/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE})
elseif(HUMMINGBIRD_TARGET_ANDROID)
    SET(HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/lib/dependencies/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE}/${ANDROID_ABI})
    SET(HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY})
    SET(HUMMINGBIRD_CONFIGURATION_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies/configuration/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE}/${ANDROID_ABI})
elseif(HUMMINGBIRD_TARGET_OSX)
    SET(HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/lib/dependencies/${CMAKE_GENERATOR})
    SET(HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
    SET(HUMMINGBIRD_CONFIGURATION_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies/configuration/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE})
elseif(HUMMINGBIRD_TARGET_MINGW)
    SET(HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/lib/dependencies/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE})
    SET(HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY})
    SET(HUMMINGBIRD_CONFIGURATION_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies/configuration/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE})
elseif(HUMMINGBIRD_TARGET_WIN32)
    SET(HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/lib/dependencies/${CMAKE_GENERATOR})
    SET(HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
    SET(HUMMINGBIRD_CONFIGURATION_DIRECTORY ${HUMMINGBIRD_REPOSITORY}/dependencies/configuration/${CMAKE_GENERATOR}/${CMAKE_BUILD_TYPE})
endif()

MESSAGE("HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY: ${HUMMINGBIRD_ARCHIVE_OUTPUT_DIRECTORY}")
MESSAGE("HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY: ${HUMMINGBIRD_DEPENDENCIES_LIBRARY_DIRECTORY}")
MESSAGE("HUMMINGBIRD_CONFIGURATION_DIRECTORY: ${HUMMINGBIRD_CONFIGURATION_DIRECTORY}")