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 oleaut32 odbccp32 shell32 advapi32 msvcrt kernel32) 7 8spec2def(selfreg.dll selfreg.spec) 9add_library(selfreg MODULE selfreg.c ${CMAKE_CURRENT_BINARY_DIR}/selfreg.def) 10set_module_type(selfreg win32dll) 11add_importlibs(selfreg advapi32 msvcrt kernel32) 12 13list(APPEND SOURCE 14 action.c 15 automation.c 16 db.c 17 format.c 18 install.c 19 msi.c 20 package.c 21 patch.c 22 record.c 23 source.c 24 suminfo.c 25 typelib.idl) 26 27list(APPEND PCH_SKIP_SOURCE 28 ${CMAKE_CURRENT_BINARY_DIR}/typelib_i.c 29 testlist.c) 30 31# CMake 3.9 and higher requires to specify this dependency manually 32# see https://gitlab.kitware.com/cmake/cmake/issues/19933 33set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom.dll ${CMAKE_CURRENT_BINARY_DIR}/selfreg.dll ${CMAKE_CURRENT_BINARY_DIR}/typelib.tlb) 34 35add_executable(msi_winetest 36 ${SOURCE} 37 ${PCH_SKIP_SOURCE} 38 msi_winetest.rc) 39 40add_idl_headers(msi_winetest_idlheader typelib.idl) 41generate_idl_iids(typelib.idl) 42add_typelib(typelib.idl) 43 44target_compile_definitions(msi_winetest PRIVATE __WINESRC__ USE_WINE_TODOS) 45 46if(CMAKE_C_COMPILER_ID STREQUAL "GNU") 47 target_compile_options(msi_winetest PRIVATE -Wno-format-overflow -Wno-format) 48 target_compile_options(custom PRIVATE -Wno-format) 49endif() 50 51# msi_winetest.rc: let rc.exe find custom.dll in its subdirectory, i.e. Debug. 52if (MSVC_IDE) 53 target_include_directories(msi_winetest PRIVATE $<$<COMPILE_LANGUAGE:RC>:$<TARGET_FILE_DIR:custom>>) 54endif() 55 56target_link_libraries(msi_winetest uuid) 57set_module_type(msi_winetest win32cui) 58add_importlibs(msi_winetest secur32 cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32) 59add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}") 60add_rostests_file(TARGET msi_winetest) 61add_dependencies(msi_winetest custom selfreg msi_winetest_idlheader stdole2) 62