https://git.reactos.org/?p=reactos.git;a=commitdiff;h=019f21ee1d764dff8586a…
commit 019f21ee1d764dff8586acc847a299714e83977a
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sun Apr 26 19:50:44 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Sun Apr 26 20:28:04 2020 +0300
[MEDIA][CMAKE] Create add_driver_inf cmake function
*.inf files for drivers can now be placed along with the driver code
---
drivers/bus/acpi/CMakeLists.txt | 1 +
{media/inf => drivers/bus/acpi}/acpi.inf | 0
drivers/filesystems/btrfs/CMakeLists.txt | 1 +
{media/inf => drivers/filesystems/btrfs}/btrfs.inf | 0
drivers/network/dd/e1000/CMakeLists.txt | 1 +
.../inf => drivers/network/dd/e1000}/nete1000.inf | 0
drivers/network/dd/ne2000/CMakeLists.txt | 1 +
.../network/dd/ne2000/netne2000.inf | 0
.../network/dd/ne2000/netrtl8029.inf | 0
drivers/network/dd/netkvm/CMakeLists.txt | 1 +
.../inf => drivers/network/dd/netkvm}/netkvm.inf | 0
drivers/network/dd/pcnet/CMakeLists.txt | 1 +
.../network/dd/pcnet/netpcnet.inf | 0
drivers/network/dd/rtl8139/CMakeLists.txt | 1 +
.../network/dd/rtl8139/netrtl8139.inf | 0
drivers/processor/processr/CMakeLists.txt | 1 +
{media/inf => drivers/processor/processr}/cpu.inf | 0
drivers/storage/class/cdrom/CMakeLists.txt | 1 +
.../inf => drivers/storage/class/cdrom}/cdrom.inf | 0
drivers/storage/class/disk/CMakeLists.txt | 1 +
{media/inf => drivers/storage/class/disk}/disk.inf | 0
drivers/storage/class/disk_new/CMakeLists.txt | 1 +
drivers/storage/floppy/fdc/CMakeLists.txt | 1 +
drivers/usb/usbstor/CMakeLists.txt | 1 +
{media/inf => drivers/usb/usbstor}/usbstor.inf | 0
drivers/wdm/audio/hdaudbus/CMakeLists.txt | 1 +
.../wdm/audio/hdaudbus}/hdaudbus.inf | 0
media/inf/CMakeLists.txt | 29 +++-------------------
sdk/cmake/CMakeMacros.cmake | 17 ++++++++++++-
win32ss/drivers/miniport/xboxvmp/CMakeLists.txt | 1 +
.../drivers/miniport/xboxvmp}/xboxdisp.inf | 0
31 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/drivers/bus/acpi/CMakeLists.txt b/drivers/bus/acpi/CMakeLists.txt
index c7be9f22ca3..69d26a13a47 100644
--- a/drivers/bus/acpi/CMakeLists.txt
+++ b/drivers/bus/acpi/CMakeLists.txt
@@ -203,6 +203,7 @@ target_link_libraries(acpi wdmguid acpica memcmp strtol ${PSEH_LIB})
add_importlibs(acpi ntoskrnl hal)
add_pch(acpi precomp.h ACPI_SOURCE)
add_cd_file(TARGET acpi DESTINATION reactos/system32/drivers NO_CAB FOR all)
+add_driver_inf(acpi acpi.inf)
add_subdirectory(cmbatt)
add_subdirectory(compbatt)
diff --git a/media/inf/acpi.inf b/drivers/bus/acpi/acpi.inf
similarity index 100%
rename from media/inf/acpi.inf
rename to drivers/bus/acpi/acpi.inf
diff --git a/drivers/filesystems/btrfs/CMakeLists.txt
b/drivers/filesystems/btrfs/CMakeLists.txt
index b45a57cb470..0fd490853ca 100644
--- a/drivers/filesystems/btrfs/CMakeLists.txt
+++ b/drivers/filesystems/btrfs/CMakeLists.txt
@@ -70,3 +70,4 @@ set_module_type(btrfs kernelmodedriver)
target_link_libraries(btrfs rtlver zlib_solo chkstk wdmguid ${PSEH_LIB})
add_importlibs(btrfs ntoskrnl hal)
add_cd_file(TARGET btrfs DESTINATION reactos/system32/drivers NO_CAB FOR all)
+add_driver_inf(btrfs btrfs.inf)
diff --git a/media/inf/btrfs.inf b/drivers/filesystems/btrfs/btrfs.inf
similarity index 100%
rename from media/inf/btrfs.inf
rename to drivers/filesystems/btrfs/btrfs.inf
diff --git a/drivers/network/dd/e1000/CMakeLists.txt
b/drivers/network/dd/e1000/CMakeLists.txt
index 2e0bf13a7e0..8bb4aa25ccf 100644
--- a/drivers/network/dd/e1000/CMakeLists.txt
+++ b/drivers/network/dd/e1000/CMakeLists.txt
@@ -19,3 +19,4 @@ add_pch(e1000 nic.h SOURCE)
set_module_type(e1000 kernelmodedriver)
add_importlibs(e1000 ndis ntoskrnl hal)
add_cd_file(TARGET e1000 DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(e1000 nete1000.inf)
diff --git a/media/inf/nete1000.inf b/drivers/network/dd/e1000/nete1000.inf
similarity index 100%
rename from media/inf/nete1000.inf
rename to drivers/network/dd/e1000/nete1000.inf
diff --git a/drivers/network/dd/ne2000/CMakeLists.txt
b/drivers/network/dd/ne2000/CMakeLists.txt
index 7e720aaa2c3..ba6af5b8526 100644
--- a/drivers/network/dd/ne2000/CMakeLists.txt
+++ b/drivers/network/dd/ne2000/CMakeLists.txt
@@ -11,3 +11,4 @@ add_pch(ne2000 include/ne2000.h SOURCE)
set_module_type(ne2000 kernelmodedriver)
add_importlibs(ne2000 ndis ntoskrnl hal)
add_cd_file(TARGET ne2000 DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(ne2000 netne2000.inf netrtl8029.inf)
diff --git a/media/inf/netisa.inf b/drivers/network/dd/ne2000/netne2000.inf
similarity index 100%
rename from media/inf/netisa.inf
rename to drivers/network/dd/ne2000/netne2000.inf
diff --git a/media/inf/netrtpnt.inf b/drivers/network/dd/ne2000/netrtl8029.inf
similarity index 100%
rename from media/inf/netrtpnt.inf
rename to drivers/network/dd/ne2000/netrtl8029.inf
diff --git a/drivers/network/dd/netkvm/CMakeLists.txt
b/drivers/network/dd/netkvm/CMakeLists.txt
index 729068401ff..881653525ad 100644
--- a/drivers/network/dd/netkvm/CMakeLists.txt
+++ b/drivers/network/dd/netkvm/CMakeLists.txt
@@ -24,6 +24,7 @@ add_library(netkvm MODULE ${SOURCE} wxp/parandis.rc)
set_module_type(netkvm kernelmodedriver)
add_importlibs(netkvm ndis ntoskrnl hal)
add_cd_file(TARGET netkvm DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(netkvm netkvm.inf)
if (NOT MSVC)
add_compile_flags("-Wno-unused-function")
diff --git a/media/inf/netkvm.inf b/drivers/network/dd/netkvm/netkvm.inf
similarity index 100%
rename from media/inf/netkvm.inf
rename to drivers/network/dd/netkvm/netkvm.inf
diff --git a/drivers/network/dd/pcnet/CMakeLists.txt
b/drivers/network/dd/pcnet/CMakeLists.txt
index 34e58268e21..439073eaff7 100644
--- a/drivers/network/dd/pcnet/CMakeLists.txt
+++ b/drivers/network/dd/pcnet/CMakeLists.txt
@@ -15,3 +15,4 @@ add_pch(pcnet pcnet.h SOURCE)
set_module_type(pcnet kernelmodedriver)
add_importlibs(pcnet ndis ntoskrnl hal)
add_cd_file(TARGET pcnet DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(pcnet netpcnet.inf)
diff --git a/media/inf/netamd.inf b/drivers/network/dd/pcnet/netpcnet.inf
similarity index 100%
rename from media/inf/netamd.inf
rename to drivers/network/dd/pcnet/netpcnet.inf
diff --git a/drivers/network/dd/rtl8139/CMakeLists.txt
b/drivers/network/dd/rtl8139/CMakeLists.txt
index 59ad7fc55e2..82b7aecf929 100644
--- a/drivers/network/dd/rtl8139/CMakeLists.txt
+++ b/drivers/network/dd/rtl8139/CMakeLists.txt
@@ -16,3 +16,4 @@ add_pch(rtl8139 nic.h SOURCE)
set_module_type(rtl8139 kernelmodedriver)
add_importlibs(rtl8139 ndis ntoskrnl hal)
add_cd_file(TARGET rtl8139 DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(rtl8139 netrtl8139.inf)
diff --git a/media/inf/netrtl.inf b/drivers/network/dd/rtl8139/netrtl8139.inf
similarity index 100%
rename from media/inf/netrtl.inf
rename to drivers/network/dd/rtl8139/netrtl8139.inf
diff --git a/drivers/processor/processr/CMakeLists.txt
b/drivers/processor/processr/CMakeLists.txt
index 9bbd366fa31..bfd8b71ddca 100644
--- a/drivers/processor/processr/CMakeLists.txt
+++ b/drivers/processor/processr/CMakeLists.txt
@@ -10,3 +10,4 @@ set_module_type(processr kernelmodedriver)
add_importlibs(processr hal ntoskrnl)
add_pch(processr processr.h SOURCE)
add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(processr cpu.inf)
diff --git a/media/inf/cpu.inf b/drivers/processor/processr/cpu.inf
similarity index 100%
rename from media/inf/cpu.inf
rename to drivers/processor/processr/cpu.inf
diff --git a/drivers/storage/class/cdrom/CMakeLists.txt
b/drivers/storage/class/cdrom/CMakeLists.txt
index c764fdfc07c..97b7a2431df 100644
--- a/drivers/storage/class/cdrom/CMakeLists.txt
+++ b/drivers/storage/class/cdrom/CMakeLists.txt
@@ -12,3 +12,4 @@ add_importlibs(cdrom class2 scsiport ntoskrnl hal)
add_pch(cdrom precomp.h SOURCE)
add_cd_file(TARGET cdrom DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_registry_inf(cdrom_reg.inf)
+add_driver_inf(cdrom cdrom.inf)
diff --git a/media/inf/cdrom.inf b/drivers/storage/class/cdrom/cdrom.inf
similarity index 100%
rename from media/inf/cdrom.inf
rename to drivers/storage/class/cdrom/cdrom.inf
diff --git a/drivers/storage/class/disk/CMakeLists.txt
b/drivers/storage/class/disk/CMakeLists.txt
index 70fdda9fb8d..eb2ff3fef4f 100644
--- a/drivers/storage/class/disk/CMakeLists.txt
+++ b/drivers/storage/class/disk/CMakeLists.txt
@@ -5,3 +5,4 @@ set_module_type(disk kernelmodedriver)
add_importlibs(disk class2 scsiport ntoskrnl hal)
add_cd_file(TARGET disk DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_registry_inf(disk_reg.inf)
+add_driver_inf(disk disk.inf)
diff --git a/media/inf/disk.inf b/drivers/storage/class/disk/disk.inf
similarity index 100%
rename from media/inf/disk.inf
rename to drivers/storage/class/disk/disk.inf
diff --git a/drivers/storage/class/disk_new/CMakeLists.txt
b/drivers/storage/class/disk_new/CMakeLists.txt
index 252f6735ff2..8860e9beea4 100644
--- a/drivers/storage/class/disk_new/CMakeLists.txt
+++ b/drivers/storage/class/disk_new/CMakeLists.txt
@@ -22,3 +22,4 @@ set_module_type(disk_new kernelmodedriver)
add_importlibs(disk_new classpnp ntoskrnl hal)
add_pch(disk_new disk.h SOURCE)
add_cd_file(TARGET disk_new DESTINATION reactos/system32/drivers NO_CAB FOR all)
+#add_driver_inf(disk_new diskdev.inf)
diff --git a/drivers/storage/floppy/fdc/CMakeLists.txt
b/drivers/storage/floppy/fdc/CMakeLists.txt
index a9c6211e912..839f77518e8 100644
--- a/drivers/storage/floppy/fdc/CMakeLists.txt
+++ b/drivers/storage/floppy/fdc/CMakeLists.txt
@@ -11,3 +11,4 @@ set_module_type(fdc kernelmodedriver)
add_importlibs(fdc hal ntoskrnl)
add_pch(fdc fdc.h SOURCE)
add_cd_file(TARGET fdc DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(fdc fdc.inf)
diff --git a/drivers/usb/usbstor/CMakeLists.txt b/drivers/usb/usbstor/CMakeLists.txt
index 82e445f0424..567ee54dd14 100644
--- a/drivers/usb/usbstor/CMakeLists.txt
+++ b/drivers/usb/usbstor/CMakeLists.txt
@@ -23,3 +23,4 @@ set_module_type(usbstor kernelmodedriver)
add_importlibs(usbstor ntoskrnl hal usbd)
add_pch(usbstor usbstor.h SOURCE)
add_cd_file(TARGET usbstor DESTINATION reactos/system32/drivers NO_CAB FOR all)
+add_driver_inf(usbstor usbstor.inf)
diff --git a/media/inf/usbstor.inf b/drivers/usb/usbstor/usbstor.inf
similarity index 100%
rename from media/inf/usbstor.inf
rename to drivers/usb/usbstor/usbstor.inf
diff --git a/drivers/wdm/audio/hdaudbus/CMakeLists.txt
b/drivers/wdm/audio/hdaudbus/CMakeLists.txt
index 952dd7242e8..3c5883dc64f 100644
--- a/drivers/wdm/audio/hdaudbus/CMakeLists.txt
+++ b/drivers/wdm/audio/hdaudbus/CMakeLists.txt
@@ -15,3 +15,4 @@ set_module_type(hdaudbus kernelmodedriver)
target_link_libraries(hdaudbus libcntpr ${PSEH_LIB})
add_importlibs(hdaudbus ntoskrnl hal)
add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all)
+add_driver_inf(hdaudbus hdaudbus.inf)
diff --git a/media/inf/hdaudbus.inf b/drivers/wdm/audio/hdaudbus/hdaudbus.inf
similarity index 100%
rename from media/inf/hdaudbus.inf
rename to drivers/wdm/audio/hdaudbus/hdaudbus.inf
diff --git a/media/inf/CMakeLists.txt b/media/inf/CMakeLists.txt
index 6d0a50bb1b6..ba9f1fcdc0c 100644
--- a/media/inf/CMakeLists.txt
+++ b/media/inf/CMakeLists.txt
@@ -1,20 +1,14 @@
list(APPEND INF_FILES
- acpi.inf
audio.inf
battery.inf
bda.inf
bth.inf
- btrfs.inf
c_image.inf
- cdrom.inf
- cpu.inf
- disk.inf
display.inf
fdc.inf
flpydisk.inf
hal.inf
- hdaudbus.inf
hdc.inf
input.inf
keyboard.inf
@@ -25,12 +19,6 @@ list(APPEND INF_FILES
monitor.inf
msmouse.inf
NET_NIC.inf
- netamd.inf
- nete1000.inf
- netisa.inf
- netkvm.inf
- netrtl.inf
- netrtpnt.inf
nettcpip.inf
ports.inf
scsi.inf
@@ -38,10 +26,8 @@ list(APPEND INF_FILES
unknown.inf
usb.inf
usbport.inf
- usbstor.inf
wdmaudio.inf
- wmiacpi.inf
- xboxdisp.inf)
+ wmiacpi.inf)
list(APPEND UTF8_INF_FILES
defltws.inf
@@ -49,17 +35,8 @@ list(APPEND UTF8_INF_FILES
intl.inf
layout.inf)
-foreach(item ${INF_FILES})
- set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${item})
- set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${item})
- add_custom_command(OUTPUT "${_converted_item}"
- COMMAND native-utf16le "${_source_item}"
"${_converted_item}"
- DEPENDS native-utf16le "${_source_item}")
- add_cd_file(TARGET converted_inf_files FILE ${_converted_item} DESTINATION
reactos/inf FOR all)
- list(APPEND _converted_inf_files ${_converted_item})
-endforeach(item)
-
-add_custom_target(converted_inf_files DEPENDS ${_converted_inf_files})
+# module name is used for a custom target creation, so we can put any unique name here
+add_driver_inf(media_inf ${INF_FILES})
foreach(item ${UTF8_INF_FILES})
add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION
reactos/inf FOR all)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index a3be90baa74..d29b95afd82 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -298,7 +298,7 @@ macro(dir_to_num dir var)
elseif(${dir} STREQUAL reactos/3rdParty)
set(${var} 63)
elseif(${dir} STREQUAL reactos/Resources/Themes/Lunar)
- set(${var} 64)
+ set(${var} 64)
elseif(${dir} STREQUAL reactos/Resources/Themes/Mizu)
set(${var} 65)
elseif(${dir} STREQUAL reactos/system32/spool/prtprocs/x64)
@@ -908,6 +908,21 @@ function(create_registry_hives)
endfunction()
+function(add_driver_inf _module)
+ # Add to the inf files list
+ foreach(_file ${ARGN})
+ set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${_file})
+ set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
+ add_custom_command(OUTPUT "${_converted_item}"
+ COMMAND native-utf16le "${_source_item}"
"${_converted_item}"
+ DEPENDS native-utf16le "${_source_item}")
+ add_cd_file(FILE ${_converted_item} DESTINATION reactos/inf FOR all)
+ list(APPEND _converted_inf_files ${_converted_item})
+ endforeach()
+
+ add_custom_target(${_module}_inf_files DEPENDS ${_converted_inf_files})
+endfunction()
+
if(KDBG)
set(ROSSYM_LIB "rossym")
else()
diff --git a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
index e9d37f0edee..2595ebb13a7 100644
--- a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
+++ b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
@@ -11,3 +11,4 @@ set_module_type(xboxvmp kernelmodedriver)
add_importlibs(xboxvmp ntoskrnl videoprt)
add_cd_file(TARGET xboxvmp DESTINATION reactos/system32/drivers FOR all)
add_registry_inf(xboxvmp_reg.inf)
+add_driver_inf(xboxvmp xboxdisp.inf)
diff --git a/media/inf/xboxdisp.inf b/win32ss/drivers/miniport/xboxvmp/xboxdisp.inf
similarity index 100%
rename from media/inf/xboxdisp.inf
rename to win32ss/drivers/miniport/xboxvmp/xboxdisp.inf