message(STATUS "Looking for unordered/hash map/set headers")
foreach(NAMESPACE_I std std::tr1)
    foreach(LOCATION_I unordered_map tr1/unordered_map)
        try_compile_code(
            HEAD "#include <${LOCATION_I}>" 
            CODE "${NAMESPACE_I}::unordered_map<int, int> t; return t.find(5) == t.end();" 
            RESULT SUCCEED)
        if (SUCCEED)
            set(LOCATION "${LOCATION_I}")
            break()
        endif()
    endforeach()
    if (SUCCEED)
        set(NAMESPACE "${NAMESPACE_I}")
        set(CLASSNAME "unordered_map")
        break()
    endif()
endforeach()
if (NOT SUCCEED)
    foreach(NAMESPACE_I __gnu_cxx "" std stdext)
        foreach(LOCATION_I ext/hash_map hash_map)
            try_compile_code(
                HEAD "#include <${LOCATION_I}>" 
                CODE "${NAMESPACE_I}::hash_map<int, int> t;" 
                RESULT SUCCEED)
            if (SUCCEED)
                set(LOCATION "${LOCATION_I}")
                break()
            endif()
        endforeach()
        if (SUCCEED)
            set(NAMESPACE "${NAMESPACE_I}")
            set(CLASSNAME "hash_map")
            break()
        endif()
    endforeach()
endif()
if (SUCCEED)
    set(HASH_NAMESPACE "${NAMESPACE}" CACHE INTERNAL "")
    set(HAVE_HASH_MAP 1 CACHE INTERNAL "")
    set(HASH_MAP_H "${LOCATION}" CACHE INTERNAL "")
    set(HASH_MAP_CLASS "${CLASSNAME}" CACHE INTERNAL "")
    string(REPLACE "map" "set" CLASSNAME ${CLASSNAME})
    string(REPLACE "map" "set" LOCATION ${LOCATION})
    set(HAVE_HASH_SET 1 CACHE INTERNAL "")
    set(HASH_SET_H "${LOCATION}" CACHE INTERNAL "")
    set(HASH_SET_CLASS "${CLASSNAME}" CACHE INTERNAL "")
endif ()