
set(NORMAL_TARGET_OUTPUT_FOLDER_BIN 
    ${CMAKE_BINARY_DIR}/bin
    CACHE INTERNAL "" FORCE
)

SET(NORMAL_TARGET_OUTPUT_FOLDER_LIB
    ${CMAKE_BINARY_DIR}/lib
    CACHE INTERNAL "" FORCE
)

function (set_normal_target_output_folder name)
    if(CMAKE_CONFIGURATION_TYPES)
        foreach(CFG ${CMAKE_CONFIGURATION_TYPES})
            string(TOUPPER ${CFG} CFG)
            set_property(TARGET ${name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY_${CFG} ${NORMAL_TARGET_OUTPUT_FOLDER_LIB})
            set_property(TARGET ${name} PROPERTY RUNTIME_OUTPUT_DIRECTORY_${CFG} ${NORMAL_TARGET_OUTPUT_FOLDER_BIN})
        endforeach(CFG CMAKE_CONFIGURATION_TYPES)
    elseif(CMAKE_BUILD_TYPE)
        string(TOUPPER ${CMAKE_BUILD_TYPE} CFG)
        set_property(TARGET ${name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY_${CFG} ${NORMAL_TARGET_OUTPUT_FOLDER_LIB})
        set_property(TARGET ${name} PROPERTY RUNTIME_OUTPUT_DIRECTORY_${CFG} ${NORMAL_TARGET_OUTPUT_FOLDER_BIN})
    endif(CMAKE_CONFIGURATION_TYPES)
endfunction(set_normal_target_output_folder)