xref: /reactos/dll/win32/shlwapi/CMakeLists.txt (revision b3194e32)
1
2project(SHELL)
3
4add_definitions(
5    -D__WINESRC__
6    -D_SHLWAPI_)
7
8spec2def(shlwapi.dll shlwapi.spec ADD_IMPORTLIB)
9
10list(APPEND SOURCE
11    clist.c
12    istream.c
13    msgbox.c
14    ordinal.c
15    path.c
16    reg.c
17    regstream.c
18    rosordinal.c
19    shlwapi_main.c
20    stopwatch.c
21    string.c
22    thread.c
23    url.c)
24
25list(APPEND PCH_SKIP_SOURCE
26    assoc.c
27    propbag.cpp
28    wsprintf.c
29    ${CMAKE_CURRENT_BINARY_DIR}/shlwapi_stubs.c)
30
31add_library(shlwapi MODULE
32    ${SOURCE}
33    ${PCH_SKIP_SOURCE}
34    $<TARGET_OBJECTS:shlwapi_autocomp>
35    shlwapi.rc
36    ${CMAKE_CURRENT_BINARY_DIR}/shlwapi.def)
37
38# our C++ atlbase.h conflicts with the one from wine, so only use wine includes for C
39# Unfortunately, we can't use different includes for C & C++ in VS generator, so use an object library to achieve this
40target_include_directories(shlwapi BEFORE PRIVATE
41    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
42    ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
43
44add_library(shlwapi_autocomp OBJECT autocomp.cpp)
45target_link_libraries(shlwapi_autocomp PRIVATE atl_classes)
46target_compile_definitions(shlwapi_autocomp PRIVATE $<TARGET_PROPERTY:shlwapi,COMPILE_DEFINITIONS>)
47target_compile_options(shlwapi_autocomp PRIVATE $<TARGET_PROPERTY:shlwapi,COMPILE_OPTIONS>)
48add_dependencies(shlwapi_autocomp psdk)
49
50set_module_type(shlwapi win32dll UNICODE)
51target_link_libraries(shlwapi uuid wine cpprt)
52add_delay_importlibs(shlwapi userenv oleaut32 ole32 comdlg32 mpr mlang urlmon shell32 winmm version)
53add_importlibs(shlwapi user32 gdi32 advapi32 wininet msvcrt kernel32 ntdll)
54add_pch(shlwapi precomp.h "${PCH_SKIP_SOURCE}")
55add_cd_file(TARGET shlwapi DESTINATION reactos/system32 FOR all)
56