
add_definitions(-D_MIDL_USE_GUIDDEF_)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

list(APPEND SOURCE
#   access.idl
    activaut.idl
    activdbg.idl
    activscp.idl
    asptlb.idl
#   asynot.idl
#   asysta.idl
    atliface.idl
    bdaiface.idl
#   binres.idl
    bits.idl
    bits1_5.idl
#   cmdbas.idl
#   cmdtxt.idl
    comcat.idl
    commoncontrols.idl
    control.idl
#   crtrow.idl
    ctxtcall.idl
#   dbccmd.idl
#   dbcses.idl
#   dbdsad.idl
#   dbinit.idl
#   dbprop.idl
#   dbs.idl
    devenum.idl
    dimm.idl
    dispex.idl
    docobj.idl
    downloadmgr.idl
#   dyngraph.idl
    exdisp.idl
    fusion.idl
    hlink.idl
    htiframe.idl
    iads.idl
    icftypes.idl
    imnact.idl
    imnxport.idl
    indexsrv.idl
    mimeinfo.idl
    mimeole.idl
    mlang.idl
    mscoree.idl
    msctf.idl
    msdadc.idl
    mshtmhst.idl
    mshtml.idl
    msinkaut.idl
    mstask.idl
    msxml.idl
    msxml2.idl
    msxml6.idl
    netcon.idl
    netfw.idl
    oaidl.idl
    objectarray.idl
    objidl.idl
    objsafe.idl
    ocidl.idl
    ocmm.idl
    oleacc.idl
    oledb.idl
    oleidl.idl
#   opnrst.idl
    optary.idl
    perhist.idl
    propidl.idl
    propsys.idl
    pstore.idl
    richole.idl
#   row.idl
#   rowchg.idl
#   rstbas.idl
#   rstinf.idl
#   rstloc.idl
    sensevts.idl
    servprov.idl
#   sesprp.idl
    shdeprecated.idl
    shldisp.idl
    shobjidl.idl
    shtypes.idl
#   stdole2.idl
    strmif.idl
    structuredquerycondition.idl
    textstor.idl
    tom.idl
    tuner.idl
    unknwn.idl
    urlhist.idl
    urlmon.idl
    vmr9.idl
#   vmrender.idl
    wia_lh.idl
    wia_xp.idl
    wincodec.idl
    winsxs.idl
    wtypes.idl
    wuapi.idl
    xmldom.idl
    xmldso.idl
    ctfutb.idl
    xmllite.idl)

if(NOT MSVC)
  list(APPEND SOURCE
    wbemcli.idl)
endif()

add_idl_headers(psdk ${SOURCE})

add_typelib(stdole2.idl)
add_custom_target(stdole2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stdole2.tlb)

add_iid_library(wuguid wuapi.idl)
add_iid_library(xml_uuids msxml2.idl)

generate_idl_iids(wincodec.idl)
