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