[CMAKE]
[reactos.git] / dll / win32 / wdmaud.drv / CMakeLists.txt
index c2aa0f9..b8784ca 100644 (file)
@@ -9,28 +9,26 @@ include_directories(
     ${REACTOS_SOURCE_DIR}/lib/drivers/sound/mmixer
     ${REACTOS_SOURCE_DIR}/lib/3rdparty/libsamplerate)
 
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wdmaud.drv.def
-                   COMMAND native-winebuild -o ${CMAKE_CURRENT_BINARY_DIR}/wdmaud.drv.def --def -E ${CMAKE_CURRENT_SOURCE_DIR}/wdmaud.spec --filename wdmaud.drv
-                   DEPENDS native-winebuild)
+spec2def(wdmaud.drv wdmaud.spec)
 
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/wdmaud.drv.def PROPERTIES GENERATED TRUE)
-add_custom_target(wdmaud.drv_def ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/wdmaud.drv.def)
-
-add_library(wdmaud.drv SHARED
+list(APPEND SOURCE
     wdmaud.c
     mixer.c
     mmixer.c
     legacy.c
-    wdmaud.rc)
+    wdmaud.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/wdmaud.def)
+
+add_library(wdmaud.drv SHARED ${SOURCE})
 
 set_module_type(wdmaud.drv win32dll)
+
 set_target_properties(wdmaud.drv PROPERTIES SUFFIX "")
 
 target_link_libraries(wdmaud.drv
-    ${CMAKE_CURRENT_BINARY_DIR}/wdmaud.drv.def
     mmebuddy
     libsamplerate
     mmixer)
 
 add_importlibs(wdmaud.drv user32 winmm advapi32 msvcrt setupapi ksuser kernel32 ntdll)
-add_dependencies(wdmaud.drv wdmaud.drv_def)
+add_cd_file(TARGET wdmaud.drv DESTINATION reactos/system32)