From 7a3cc8db7f63236104e9742fc2c27ee1d882b0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nagy-Egri=20M=C3=A1t=C3=A9=20Ferenc?= Date: Sat, 13 Oct 2018 00:07:30 +0200 Subject: [PATCH] [hwloc] Added utility hwloc-info (#4279) * Added version number to project() invocation * Added URL to project() invocation * added hwloc-info target and install() * Removed URL (oops), fixed hwloc-info when using shared libs * [hwloc] Bump control version. Don't package debug version of hwloc-info. --- ports/hwloc/CMakeLists.txt | 24 +++++++++++++++++++++--- ports/hwloc/CONTROL | 2 +- ports/hwloc/portfile.cmake | 2 ++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ports/hwloc/CMakeLists.txt b/ports/hwloc/CMakeLists.txt index 7f75c558c5..1b2e1c802d 100644 --- a/ports/hwloc/CMakeLists.txt +++ b/ports/hwloc/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.0) -project(hwloc C) +project(hwloc + LANGUAGES C + VERSION 1.11.7) configure_file(contrib/windows/hwloc_config.h include/hwloc/autogen/config.h COPYONLY) configure_file(contrib/windows/static-components.h include/static-components.h COPYONLY) @@ -36,14 +38,30 @@ add_library(libhwloc src/dolib.c) set_target_properties(libhwloc PROPERTIES DEFINE_SYMBOL _USRDLL) -target_include_directories(libhwloc PRIVATE ./include ./src ${CMAKE_CURRENT_BINARY_DIR}/include) -target_compile_definitions(libhwloc PRIVATE _CRT_SECURE_NO_WARNINGS) + +add_executable(hwloc-info + utils/hwloc/hwloc-info.c) + +target_link_libraries(hwloc-info PRIVATE libhwloc) + +foreach(Target IN ITEMS libhwloc hwloc-info) + target_include_directories(${Target} PRIVATE ./include ./src ${CMAKE_CURRENT_BINARY_DIR}/include) + target_compile_definitions(${Target} PRIVATE _CRT_SECURE_NO_WARNINGS) +endforeach(Target) install(TARGETS libhwloc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +install(TARGETS hwloc-info + RUNTIME DESTINATION tools/hwloc) +if(BUILD_SHARED_LIBS) + install(TARGETS libhwloc + RUNTIME DESTINATION tools/hwloc) +endif(BUILD_SHARED_LIBS) + + if(NOT HWLOC_SKIP_INCLUDES) install(FILES include/hwloc.h DESTINATION include) install(DIRECTORY include/hwloc DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/ports/hwloc/CONTROL b/ports/hwloc/CONTROL index ef2564050c..e2c820060b 100644 --- a/ports/hwloc/CONTROL +++ b/ports/hwloc/CONTROL @@ -1,4 +1,4 @@ Source: hwloc -Version: 1.11.7-2 +Version: 1.11.7-3 Description: Portable Hardware Locality (hwloc) The Portable Hardware Locality (hwloc) software package provides a portable abstraction (across OS, versions, architectures, ...) of the hierarchical topology of modern architectures, including NUMA memory nodes, sockets, shared caches, cores and simultaneous multithreading. It also gathers various system attributes such as cache and memory information as well as the locality of I/O devices such as network interfaces, InfiniBand HCAs or GPUs. diff --git a/ports/hwloc/portfile.cmake b/ports/hwloc/portfile.cmake index a2031bdcb6..64a18ddc73 100644 --- a/ports/hwloc/portfile.cmake +++ b/ports/hwloc/portfile.cmake @@ -28,6 +28,8 @@ else() endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h "${PUBLIC_CONFIG_H}") +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/tools) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/hwloc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/hwloc/COPYING ${CURRENT_PACKAGES_DIR}/share/hwloc/copyright)