[CMAKE]
[reactos.git] / dll / win32 / dbghelp / CMakeLists.txt
index 099da6a..4b1c073 100644 (file)
@@ -5,6 +5,7 @@ add_definitions(
     -D__USE_CRTIMP
     -D_WINE
     -DHAVE_REGEX_H
+    -DHAVE_ALLOCA_H
     -D_IMAGEHLP_SOURCE_)
 
 if(ARCH MATCHES amd64)
@@ -13,9 +14,11 @@ endif(ARCH MATCHES amd64)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-spec2def(dbghelp ${CMAKE_CURRENT_SOURCE_DIR}/dbghelp.spec ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def)
+set_rc_compiler()
 
-add_library(dbghelp SHARED
+spec2def(dbghelp.dll dbghelp.spec)
+
+list(APPEND SOURCE
     coff.c
     cpu_i386.c
     cpu_ppc.c
@@ -39,16 +42,19 @@ add_library(dbghelp SHARED
     storage.c
     symbol.c
     type.c
-    version.rc)
+    version.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def)
+
+add_library(dbghelp SHARED ${SOURCE})
 
 set_module_type(dbghelp win32dll)
 
 target_link_libraries(dbghelp
-    ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def
     wine
-    pseh
+    ${PSEH_LIB}
     oldnames)
 
 add_importlibs(dbghelp psapi version msvcrt kernel32 ntdll)
-add_dependencies(dbghelp dbghelp_def)
-add_cab_target(dbghelp 1)
+add_importlib_target(dbghelp.spec)
+add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)