[plibsys] Update to 0.0.5 and fix CMake export (#42518)

This commit is contained in:
MonicaLiu 2024-12-05 14:37:00 -08:00 committed by GitHub
parent 11fc04c9dc
commit 04e2fbc675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 58 additions and 54 deletions

View File

@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 343e3d2..aff7929 100644 index 12cad07..cda9f76 100644
--- a/src/CMakeLists.txt --- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt +++ b/src/CMakeLists.txt
@@ -785,18 +785,18 @@ if (PLIBSYS_PLATFORM_DEFINES) @@ -827,10 +827,10 @@ if (PLIBSYS_PLATFORM_DEFINES)
endif() endif()
# Add targets # Add targets
@ -14,18 +14,41 @@ index 343e3d2..aff7929 100644
+ add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS}) + add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS})
endif() endif()
# Prepare installation dirs
@@ -838,6 +838,10 @@ if (NOT CMAKE_INSTALL_LIBDIR)
set (CMAKE_INSTALL_LIBDIR "lib")
endif()
+if (NOT CMAKE_INSTALL_BINDIR)
+ set (CMAKE_INSTALL_BINDIR "bin")
+endif()
+
if (NOT CMAKE_INSTALL_INCLUDEDIR)
set (CMAKE_INSTALL_INCLUDEDIR "include")
endif()
@@ -846,16 +850,16 @@ set (PLIBSYS_INCL_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/plibsys)
# Add include directories # Add include directories
if (COMMAND target_include_directories) if (COMMAND target_include_directories)
- target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS}) - target_include_directories (plibsys PUBLIC
- "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
- "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
- )
- -
if (PLIBSYS_BUILD_STATIC) if (PLIBSYS_BUILD_STATIC)
target_include_directories (plibsysstatic PUBLIC ${PLIBSYS_INCLUDE_DIRS}) target_include_directories (plibsysstatic PUBLIC
"$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
)
+ else() + else()
+ target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS}) + target_include_directories (plibsys PUBLIC
+ "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
+ "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
+ )
endif() endif()
else() else()
include_directories (${PLIBSYS_INCLUDE_DIRS}) include_directories (${PLIBSYS_INCLUDE_DIRS})
@@ -804,15 +804,16 @@ endif() @@ -863,15 +867,16 @@ endif()
# Add compile definitions # Add compile definitions
if (COMMAND target_compile_definitions) if (COMMAND target_compile_definitions)
@ -44,7 +67,7 @@ index 343e3d2..aff7929 100644
set_target_properties (plibsys PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) set_target_properties (plibsys PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties (plibsys PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR}) set_target_properties (plibsys PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
@@ -820,6 +821,7 @@ set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR} @@ -884,6 +889,7 @@ endif()
if (NOT PLIBSYS_TARGET_OS STREQUAL os2 AND NOT PLIBSYS_TARGET_OS STREQUAL amigaos) if (NOT PLIBSYS_TARGET_OS STREQUAL os2 AND NOT PLIBSYS_TARGET_OS STREQUAL amigaos)
set_target_properties (plibsys PROPERTIES SOVERSION ${PLIBSYS_SOVERSION}) set_target_properties (plibsys PROPERTIES SOVERSION ${PLIBSYS_SOVERSION})
endif() endif()
@ -52,7 +75,7 @@ index 343e3d2..aff7929 100644
if (PLIBSYS_BUILD_STATIC) if (PLIBSYS_BUILD_STATIC)
set_target_properties (plibsysstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) set_target_properties (plibsysstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
@@ -834,10 +836,10 @@ if (PLIBSYS_PLATFORM_CFLAGS) @@ -898,10 +904,10 @@ if (PLIBSYS_PLATFORM_CFLAGS)
set (PLIBSYS_PLATFORM_CFLAGS_STR "${PLIBSYS_PLATFORM_CFLAGS_STR} ${PLATFORM_CFLAG}") set (PLIBSYS_PLATFORM_CFLAGS_STR "${PLIBSYS_PLATFORM_CFLAGS_STR} ${PLATFORM_CFLAG}")
endforeach() endforeach()
@ -65,7 +88,7 @@ index 343e3d2..aff7929 100644
endif() endif()
endif() endif()
@@ -846,29 +848,30 @@ if (PLIBSYS_PLATFORM_LDFLAGS) @@ -910,29 +916,29 @@ if (PLIBSYS_PLATFORM_LDFLAGS)
set (PLIBSYS_PLATFORM_LDFLAGS_STR "${PLIBSYS_PLATFORM_LDFLAGS_STR} ${PLATFORM_LDFLAG}") set (PLIBSYS_PLATFORM_LDFLAGS_STR "${PLIBSYS_PLATFORM_LDFLAGS_STR} ${PLATFORM_LDFLAG}")
endforeach() endforeach()
@ -79,12 +102,11 @@ index 343e3d2..aff7929 100644
endif() endif()
-target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) -target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
-
if (PLIBSYS_BUILD_STATIC) if (PLIBSYS_BUILD_STATIC)
- target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+ target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+else() +else()
+ target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES}) + target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
endif() endif()
if (PLIBSYS_BUILD_STATIC) if (PLIBSYS_BUILD_STATIC)
@ -103,7 +125,7 @@ index 343e3d2..aff7929 100644
COMPONENT Core COMPONENT Core
) )
@@ -878,11 +881,6 @@ if (PLIBSYS_NATIVE_WINDOWS) @@ -942,11 +948,6 @@ if (PLIBSYS_NATIVE_WINDOWS)
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include (InstallRequiredSystemLibraries) include (InstallRequiredSystemLibraries)
@ -114,20 +136,11 @@ index 343e3d2..aff7929 100644
- ) - )
endif() endif()
# Prepare installation dirs set (PLIBSYS_EXPORT_NAME plibsys-targets)
@@ -890,18 +888,18 @@ if (NOT CMAKE_INSTALL_LIBDIR) @@ -974,13 +975,9 @@ endif()
set (CMAKE_INSTALL_LIBDIR "lib")
endif()
+if (NOT CMAKE_INSTALL_BINDIR) install (TARGETS ${PLIBSYS_INSTALL_TARGETS}
+ set (CMAKE_INSTALL_BINDIR "bin") EXPORT ${PLIBSYS_EXPORT_NAME}
+endif()
+
if (NOT CMAKE_INSTALL_INCLUDEDIR)
set (CMAKE_INSTALL_INCLUDEDIR "include")
endif()
install (TARGETS ${PLIBSYS_INSTALL_TARGETS} EXPORT plibsys-targets
- DESTINATION ${CMAKE_INSTALL_LIBDIR} - DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- COMPONENT Core - COMPONENT Core

View File

@ -1,8 +1,8 @@
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO saprykin/plibsys REPO saprykin/plibsys
REF 0.0.4 REF "${VERSION}"
SHA512 61957666fb454469e1ff68435463eaf426e960caed33540dbb495e1aa7c446c9803d100f33f1a6ea70d5f2ee2d0d19ec315f3a8c651747f65a186ad061c05e51 SHA512 ccc4dd0e54d69121542f4ddec319ec9fd2069866a93135acb87fe564c7bd067a218038dfaa4ddda4debcd897975c016165cbe3d41af6c2149d2b49fbe52f8fbb
HEAD_REF master HEAD_REF master
PATCHES PATCHES
fix_configuration.patch fix_configuration.patch
@ -17,14 +17,14 @@ vcpkg_cmake_configure(
-DPLIBSYS_COVERAGE=OFF -DPLIBSYS_COVERAGE=OFF
-DPLIBSYS_BUILD_DOC=OFF -DPLIBSYS_BUILD_DOC=OFF
-DPLIBSYS_BUILD_STATIC=${PLIBSYS_STATIC} -DPLIBSYS_BUILD_STATIC=${PLIBSYS_STATIC}
-DPLIBSYS_WRITE_PACKAGE=TRUE
) )
vcpkg_cmake_install() vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/plibsys)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,5 +0,0 @@
The package plibsys provides CMake targets:
find_package(plibsys CONFIG REQUIRED)
target_include_directories(main PRIVATE ${PLIBSYS_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${PLIBSYS_LIBRARIES})

View File

@ -1,12 +0,0 @@
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)
find_path(PLIBSYS_INCLUDE_DIR NAMES plibsys.h HINTS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} PATH_SUFFIXES plibsys)
find_library(PLIBSYS_LIBRARY_DEBUG NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(PLIBSYS_LIBRARY_RELEASE NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)
select_library_configurations(PLIBSYS)
set(PLIBSYS_INCLUDE_DIRS ${PLIBSYS_INCLUDE_DIR})
set(PLIBSYS_LIBRARIES ${PLIBSYS_LIBRARY})

View File

@ -1,7 +1,6 @@
{ {
"name": "plibsys", "name": "plibsys",
"version": "0.0.4", "version": "0.0.5",
"port-version": 7,
"description": "Highly portable C system library: threads and synchronization, sockets, IPC, data structures and more.", "description": "Highly portable C system library: threads and synchronization, sockets, IPC, data structures and more.",
"homepage": "https://github.com/saprykin/plibsys", "homepage": "https://github.com/saprykin/plibsys",
"supports": "!uwp", "supports": "!uwp",
@ -9,6 +8,10 @@
{ {
"name": "vcpkg-cmake", "name": "vcpkg-cmake",
"host": true "host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
} }
] ]
} }

View File

@ -7069,8 +7069,8 @@
"port-version": 8 "port-version": 8
}, },
"plibsys": { "plibsys": {
"baseline": "0.0.4", "baseline": "0.0.5",
"port-version": 7 "port-version": 0
}, },
"plog": { "plog": {
"baseline": "1.1.10", "baseline": "1.1.10",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "fd135be00a7b86144ec0fc7a067a3e6d543a725c",
"version": "0.0.5",
"port-version": 0
},
{ {
"git-tree": "9640c4c329d7aa6e7cf09a193f621750ea2d02bd", "git-tree": "9640c4c329d7aa6e7cf09a193f621750ea2d02bd",
"version": "0.0.4", "version": "0.0.4",