1
2add_definitions(
3    -D__WINESRC__
4    -DENTRY_PREFIX=WIC_
5    -DPROXY_DELEGATION
6    -DWINE_REGISTER_DLL)
7
8remove_definitions(-D_WIN32_WINNT=0x502)
9add_definitions(-D_WIN32_WINNT=0x600)
10
11include_directories(
12    BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
13    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libjpeg
14    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
15    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libpng
16    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libtiff)
17
18if(MSVC)
19    add_compile_flags("/FItypeof.h")
20endif()
21
22spec2def(windowscodecs.dll windowscodecs.spec ADD_IMPORTLIB)
23add_rpcproxy_files(windowscodecs_wincodec.idl)
24
25list(APPEND SOURCE
26    bmpdecode.c
27    bmpencode.c
28    clipper.c
29    clsfactory.c
30    colorcontext.c
31    colortransform.c
32    converter.c
33    fliprotate.c
34    gifformat.c
35    icnsformat.c
36    icoformat.c
37    imgfactory.c
38    info.c
39    jpegformat.c
40    main.c
41    metadatahandler.c
42    metadataquery.c
43    palette.c
44    pngformat.c
45    propertybag.c
46    proxy.c
47    regsvr.c
48    scaler.c
49    stream.c
50    tgaformat.c
51    tiffformat.c
52    ungif.c
53    wincodecs_private.h)
54
55if(MSVC)
56    if(ARCH STREQUAL "i386")
57        list(APPEND SOURCE msvc-thiscall.c)
58    endif()
59    set_source_files_properties(bitmap.c PROPERTIES COMPILE_FLAGS "/FImsvc.h")
60    list(APPEND ADDITIONAL_SOURCE bitmap.c)
61else()
62    list(APPEND SOURCE bitmap.c)
63endif()
64
65list(APPEND ADDITIONAL_SOURCE
66    guid.c
67    version.rc
68    ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
69    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs_stubs.c
70    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def
71    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs_wincodec_p.c)
72
73add_library(windowscodecs SHARED
74    ${SOURCE}
75    ${ADDITIONAL_SOURCE})
76
77set_module_type(windowscodecs win32dll)
78target_link_libraries(windowscodecs wine uuid ${PSEH_LIB})
79add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista propsys msvcrt kernel32 ntdll)
80add_pch(windowscodecs wincodecs_private.h SOURCE)
81add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all)
82