[cctz] Use official CMakeLists.txt (#33958)

This commit is contained in:
Osyotr 2023-09-26 09:48:43 +03:00 committed by GitHub
parent 62988594de
commit 8f7a19d17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 53 deletions

View File

@ -1,40 +0,0 @@
cmake_minimum_required(VERSION 3.8)
project(cctz CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_DEBUG_POSTFIX d)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
option(INSTALL_HEADERS "Install header files" ON)
else()
option(INSTALL_HEADERS "Install header files" OFF)
endif()
find_package(benchmark CONFIG REQUIRED)
file(GLOB SOURCES src/*.cc)
list(FILTER SOURCES EXCLUDE REGEX "_test.cc$|benchmarks|_tool.cc$")
file(GLOB HEADERS include/cctz/*.h)
add_library(cctz ${SOURCES})
target_include_directories(cctz PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
target_link_libraries(cctz PRIVATE benchmark::benchmark benchmark::benchmark_main)
if(INSTALL_HEADERS)
install(FILES ${HEADERS} DESTINATION "include/cctz")
endif()
install(TARGETS cctz EXPORT unofficial-cctz-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(
EXPORT unofficial-cctz-targets
FILE unofficial-cctz-config.cmake
NAMESPACE unofficial::
DESTINATION share/unofficial-cctz
)

View File

@ -1,7 +1,3 @@
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "${PORT} does not currently support UWP")
endif()
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
@ -12,16 +8,17 @@ vcpkg_from_github(
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TOOLS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-cctz)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

View File

@ -1,11 +1,10 @@
{
"name": "cctz",
"version": "2.3",
"port-version": 5,
"port-version": 6,
"description": "two libraries that cooperate with <chrono> to give C++ programmers all the necessary tools for computing with dates, times, and time zones in a simple and correct manner.",
"homepage": "https://github.com/google/cctz",
"dependencies": [
"benchmark",
{
"name": "vcpkg-cmake",
"host": true

View File

@ -1458,7 +1458,7 @@
},
"cctz": {
"baseline": "2.3",
"port-version": 5
"port-version": 6
},
"cdt": {
"baseline": "1.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "02114f18edd1088204f039ab6bc662e23d2e4fcc",
"version": "2.3",
"port-version": 6
},
{
"git-tree": "4fb611037401f6c457c45f90d7a462fa13f6f1b1",
"version": "2.3",