Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename hwinfo to lfreist-hwinfo when use find_package() #107

Merged
merged 3 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ add_subdirectory(src)

include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/hwinfoConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/lfreist-hwinfoConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_file(cmake/hwinfoConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/hwinfoConfig.cmake"
configure_file(cmake/lfreist-hwinfoConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/lfreist-hwinfoConfig.cmake"
@ONLY
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/hwinfoConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/hwinfoConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/lfreist-hwinfoConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/lfreist-hwinfoConfigVersion.cmake"
DESTINATION lib/cmake/hwinfo
)
install(EXPORT hwinfoTargets
FILE hwinfoTargets.cmake
NAMESPACE hwinfo::
install(EXPORT lfreist-hwinfoTargets
FILE lfreist-hwinfoTargets.cmake
NAMESPACE lfreist-hwinfo::
DESTINATION lib/cmake/hwinfo
)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Disk 4:
4. Link it in cmake
```cmake
add_executable(your_executable your_executable.cpp)
target_link_libraries(your_executable PUBLIC hwinfo::hwinfo)
target_link_libraries(your_executable PUBLIC lfreist-hwinfo::hwinfo)
```


Expand Down Expand Up @@ -261,5 +261,5 @@ Disk 4:
4. Link it in cmake
```cmake
add_executable(your_executable your_executable.cpp)
target_link_libraries(your_executable PUBLIC hwinfo::hwinfo)
target_link_libraries(your_executable PUBLIC lfreist-hwinfo::hwinfo)
```
3 changes: 0 additions & 3 deletions cmake/hwinfoConfig.cmake.in

This file was deleted.

3 changes: 3 additions & 0 deletions cmake/lfreist-hwinfoConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/lfreist-hwinfoTargets.cmake")
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ endif ()

add_executable(system_info system_infoMain.cpp)

target_link_libraries(system_info PRIVATE hwinfo::hwinfo fmt::fmt)
target_link_libraries(system_info PRIVATE lfreist-hwinfo::hwinfo fmt::fmt)

install(TARGETS system_info)
18 changes: 9 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----- hwinfo ---------------------------------------------------------------------------------------------------------
add_library(hwinfo INTERFACE)
target_include_directories(hwinfo INTERFACE $<BUILD_INTERFACE:${HWINFO_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
add_library(hwinfo::hwinfo ALIAS hwinfo)
add_library(lfreist-hwinfo::hwinfo ALIAS hwinfo)
set_target_properties(hwinfo PROPERTIES OUTPUT_NAME "hwinfo")

# === Components =======================================================================================================
Expand Down Expand Up @@ -30,7 +30,7 @@ if (HWINFO_BATTERY)
set_target_properties(hwinfo_battery PROPERTIES OUTPUT_NAME "hwinfo_battery")

install(TARGETS hwinfo_battery
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -62,7 +62,7 @@ if (HWINFO_CPU)
set_target_properties(hwinfo_cpu PROPERTIES OUTPUT_NAME "hwinfo_cpu")

install(TARGETS hwinfo_cpu
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -97,7 +97,7 @@ if (HWINFO_DISK)
set_target_properties(hwinfo_disk PROPERTIES OUTPUT_NAME "hwinfo_disk")

install(TARGETS hwinfo_disk
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -140,7 +140,7 @@ if (HWINFO_GPU)
set_target_properties(hwinfo_gpu PROPERTIES OUTPUT_NAME "hwinfo_gpu")

install(TARGETS hwinfo_gpu
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -175,7 +175,7 @@ if (HWINFO_MAINBOARD)
set_target_properties(hwinfo_mainboard PROPERTIES OUTPUT_NAME "hwinfo_mainboard")

install(TARGETS hwinfo_mainboard
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -209,7 +209,7 @@ if (HWINFO_OS)
set_target_properties(hwinfo_os PROPERTIES OUTPUT_NAME "hwinfo_os")

install(TARGETS hwinfo_os
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -241,7 +241,7 @@ if (HWINFO_RAM)
set_target_properties(hwinfo_ram PROPERTIES OUTPUT_NAME "hwinfo_ram")

install(TARGETS hwinfo_ram
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
Expand All @@ -253,7 +253,7 @@ endif ()
install(FILES ${HWINFO_INCLUDE_DIR}/hwinfo/platform.h ${HWINFO_INCLUDE_DIR}/hwinfo/hwinfo.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hwinfo)
install(DIRECTORY ${HWINFO_INCLUDE_DIR}/hwinfo/utils DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hwinfo)
install(TARGETS hwinfo
EXPORT hwinfoTargets
EXPORT lfreist-hwinfoTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
Expand Down
Loading