1
2add_definitions(
3    -DUSE_WINE_TODOS
4    -D__WINESRC__)
5
6if(MSVC_IDE)
7    # msi_winetest.rc: let rc.exe find custom.dll in its subdirectory, i.e. Debug.
8    include_directories($<TARGET_FILE_DIR:custom>)
9endif()
10
11if(GCC AND GCC_VERSION VERSION_GREATER 7)
12    add_compile_flags("-Wno-format-overflow")
13endif()
14
15spec2def(custom.dll custom.spec)
16add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def)
17target_link_libraries(custom uuid)
18set_module_type(custom win32dll)
19add_importlibs(custom msi ole32 msvcrt kernel32)
20
21list(APPEND SOURCE
22    action.c
23    automation.c
24    db.c
25    format.c
26    install.c
27    msi.c
28    package.c
29    patch.c
30    record.c
31    source.c
32    suminfo.c
33    precomp.h)
34
35if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9.0")
36    # CMake 3.9 and higher requires to specify this dependency manually
37    # see https://gitlab.kitware.com/cmake/cmake/issues/19933
38    set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS custom.dll)
39endif()
40
41add_executable(msi_winetest ${SOURCE} testlist.c msi_winetest.rc)
42target_link_libraries(msi_winetest uuid)
43set_module_type(msi_winetest win32cui)
44add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 user32 advapi32 version msvcrt kernel32)
45add_pch(msi_winetest precomp.h SOURCE)
46add_rostests_file(TARGET msi_winetest)
47add_dependencies(msi_winetest custom)
48