Skip to content

Commit

Permalink
fix windows ninja build failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlongyu committed Aug 17, 2024
1 parent 994b1bf commit 249eff9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set_target_properties(hwinfo PROPERTIES OUTPUT_NAME "hwinfo")
add_library(hwinfo_static INTERFACE)
target_include_directories(hwinfo_static INTERFACE $<BUILD_INTERFACE:${HWINFO_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
add_library(hwinfo::hwinfo_static ALIAS hwinfo_static)
set_target_properties(hwinfo_static PROPERTIES OUTPUT_NAME "hwinfo")
set_target_properties(hwinfo_static PROPERTIES OUTPUT_NAME "hwinfo_static")

# === Components =======================================================================================================
# ----- BATTERY --------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -38,7 +38,7 @@ if (HWINFO_BATTERY)
target_link_libraries(hwinfo_static INTERFACE hwinfo_battery_static)

set_target_properties(hwinfo_battery PROPERTIES OUTPUT_NAME "hwinfo_battery")
set_target_properties(hwinfo_battery_static PROPERTIES OUTPUT_NAME "hwinfo_battery")
set_target_properties(hwinfo_battery_static PROPERTIES OUTPUT_NAME "hwinfo_battery_static")

install(TARGETS hwinfo_battery hwinfo_battery_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -72,7 +72,7 @@ if (HWINFO_CPU)
target_link_libraries(hwinfo_static INTERFACE hwinfo_cpu_static)

set_target_properties(hwinfo_cpu PROPERTIES OUTPUT_NAME "hwinfo_cpu")
set_target_properties(hwinfo_cpu_static PROPERTIES OUTPUT_NAME "hwinfo_cpu")
set_target_properties(hwinfo_cpu_static PROPERTIES OUTPUT_NAME "hwinfo_cpu_static")

install(TARGETS hwinfo_cpu hwinfo_cpu_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -104,14 +104,14 @@ if (HWINFO_DISK)
add_library(hwinfo_disk_static STATIC ${DISK_SRC_FILES})
target_include_directories(hwinfo_disk_static PUBLIC $<BUILD_INTERFACE:${HWINFO_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(APPLE)
target_link_libraries(hwinfo_disk_static PRIVATE "-framework IOKit" "-framework CoreFoundation")
target_link_libraries(hwinfo_disk_static PRIVATE "-framework IOKit" "-framework CoreFoundation_static")
endif()

target_link_libraries(hwinfo INTERFACE hwinfo_disk)
target_link_libraries(hwinfo_static INTERFACE hwinfo_disk_static)

set_target_properties(hwinfo_disk PROPERTIES OUTPUT_NAME "hwinfo_disk")
set_target_properties(hwinfo_disk_static PROPERTIES OUTPUT_NAME "hwinfo_disk")
set_target_properties(hwinfo_disk_static PROPERTIES OUTPUT_NAME "hwinfo_disk_static")

install(TARGETS hwinfo_disk hwinfo_disk_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -159,7 +159,7 @@ if (HWINFO_GPU)
target_link_libraries(hwinfo_static INTERFACE hwinfo_gpu_static)

set_target_properties(hwinfo_gpu PROPERTIES OUTPUT_NAME "hwinfo_gpu")
set_target_properties(hwinfo_gpu_static PROPERTIES OUTPUT_NAME "hwinfo_gpu")
set_target_properties(hwinfo_gpu_static PROPERTIES OUTPUT_NAME "hwinfo_gpu_static")

install(TARGETS hwinfo_gpu hwinfo_gpu_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -196,7 +196,7 @@ if (HWINFO_MAINBOARD)
target_link_libraries(hwinfo_static INTERFACE hwinfo_mainboard_static)

set_target_properties(hwinfo_mainboard PROPERTIES OUTPUT_NAME "hwinfo_mainboard")
set_target_properties(hwinfo_mainboard_static PROPERTIES OUTPUT_NAME "hwinfo_mainboard")
set_target_properties(hwinfo_mainboard_static PROPERTIES OUTPUT_NAME "hwinfo_mainboard_static")

install(TARGETS hwinfo_mainboard hwinfo_mainboard_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -230,7 +230,7 @@ if (HWINFO_OS)
target_link_libraries(hwinfo_static INTERFACE hwinfo_os_static)

set_target_properties(hwinfo_os PROPERTIES OUTPUT_NAME "hwinfo_os")
set_target_properties(hwinfo_os_static PROPERTIES OUTPUT_NAME "hwinfo_os")
set_target_properties(hwinfo_os_static PROPERTIES OUTPUT_NAME "hwinfo_os_static")

install(TARGETS hwinfo_os hwinfo_os_static
EXPORT hwinfoTargets
Expand Down Expand Up @@ -264,7 +264,7 @@ if (HWINFO_RAM)
target_link_libraries(hwinfo_static INTERFACE hwinfo_ram_static)

set_target_properties(hwinfo_ram PROPERTIES OUTPUT_NAME "hwinfo_ram")
set_target_properties(hwinfo_ram_static PROPERTIES OUTPUT_NAME "hwinfo_ram")
set_target_properties(hwinfo_ram_static PROPERTIES OUTPUT_NAME "hwinfo_ram_static")

install(TARGETS hwinfo_ram hwinfo_ram_static
EXPORT hwinfoTargets
Expand Down

0 comments on commit 249eff9

Please sign in to comment.