early-access version 2853
This commit is contained in:
39
externals/vcpkg/ports/unicorn-lib/CMakeLists.txt
vendored
Executable file
39
externals/vcpkg/ports/unicorn-lib/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(Unicorn_Lib LANGUAGES CXX DESCRIPTION "Unicode library for C++ by Ross Smith")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
option(UNICORN_LIB_SKIP_HEADERS "If the headers installation is skipped or not." OFF)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_library(PCRE2_LIBRARY_DEBUG NAMES pcre2-8d pcre2-8-staticd HINTS ${INSTALLED_LIB_PATH})
|
||||
find_library(PCRE2_LIBRARY_RELEASE NAMES pcre2-8 pcre2-8-static HINTS ${INSTALLED_LIB_PATH})
|
||||
select_library_configurations(PCRE2)
|
||||
|
||||
file(GLOB_RECURSE UNICORN_LIB_SOURCES ${PROJECT_SOURCE_DIR}/unicorn/*.cpp)
|
||||
foreach(ITR ${UNICORN_LIB_SOURCES})
|
||||
if(ITR MATCHES "(.*)-test.cpp(.*)")
|
||||
list(REMOVE_ITEM UNICORN_LIB_SOURCES ${ITR})
|
||||
endif()
|
||||
endforeach()
|
||||
add_library(unicorn-lib ${UNICORN_LIB_SOURCES})
|
||||
target_include_directories(
|
||||
unicorn-lib
|
||||
PUBLIC ${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
target_compile_definitions(
|
||||
unicorn-lib
|
||||
PRIVATE -DUNICODE -D_UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
|
||||
target_link_libraries(unicorn-lib PUBLIC ${PCRE2_LIBRARY})
|
||||
target_link_libraries(unicorn-lib PUBLIC ZLIB::ZLIB)
|
||||
|
||||
if(NOT UNICORN_LIB_SKIP_HEADERS)
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/unicorn DESTINATION include FILES_MATCHING PATTERN "*.hpp")
|
||||
endif()
|
||||
install(TARGETS unicorn-lib
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
27
externals/vcpkg/ports/unicorn-lib/portfile.cmake
vendored
Executable file
27
externals/vcpkg/ports/unicorn-lib/portfile.cmake
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
message("unicorn-lib is a static library, now build with static.")
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO CaptainCrowbar/unicorn-lib
|
||||
REF 44e975ffc8dcd8dedbe01a8cbe7812e351f3f74f # 2022-01-24
|
||||
SHA512 b22264420174c950ca8025e861366118d79a53edce9297d84af9511e255af5971c3719f0b464f4a4886848edea7c2ba4ae32ce9abab135628d64adbde5fa7b0d
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CURRENT_PORT_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG
|
||||
-DUNICORN_LIB_SKIP_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
19
externals/vcpkg/ports/unicorn-lib/vcpkg.json
vendored
Executable file
19
externals/vcpkg/ports/unicorn-lib/vcpkg.json
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "unicorn-lib",
|
||||
"version-date": "2022-01-24",
|
||||
"description": "Unicode library for C++ by Ross Smith",
|
||||
"homepage": "https://github.com/CaptainCrowbar/unicorn-lib",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
"pcre2",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user