[CMAKE]
[reactos.git] / dll / win32 / setupapi / CMakeLists.txt
index cbcfe3e..be426e2 100644 (file)
@@ -12,9 +12,10 @@ include_directories(
     ${REACTOS_SOURCE_DIR}/include/reactos/wine
     ${REACTOS_BINARY_DIR}/include/reactos/idl)
 
-spec2def(setupapi ${CMAKE_CURRENT_SOURCE_DIR}/setupapi.spec ${CMAKE_CURRENT_BINARY_DIR}/setupapi.def)
+set_rc_compiler()
+spec2def(setupapi.dll setupapi.spec)
 
-add_library(setupapi SHARED
+list(APPEND SOURCE
     cfgmgr.c
     devclass.c
     devinst.c
@@ -31,16 +32,19 @@ add_library(setupapi SHARED
     stringtable.c
     stubs.c
     rpc.c
-    setupapi.rc)
+    setupapi.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/setupapi_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/setupapi.def)
+
+add_library(setupapi SHARED ${SOURCE})
 
 set_module_type(setupapi win32dll)
 
 target_link_libraries(setupapi
-    ${CMAKE_CURRENT_BINARY_DIR}/setupapi.def
-    pnp_client
+    pnprpc
     uuid
     wine
-    pseh)
+    ${PSEH_LIB})
 
 add_importlibs(setupapi
     msvcrt
@@ -54,5 +58,6 @@ add_importlibs(setupapi
     kernel32
     ntdll)
 
-add_dependencies(setupapi setupapi_def)
-add_cab_target(setupapi 1)
+
+add_cd_file(TARGET setupapi DESTINATION reactos/system32)
+add_importlib_target(setupapi.spec)