Skip to content
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
13 changes: 12 additions & 1 deletion ports/unicorn-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ option(UNICORN_LIB_SKIP_HEADERS "If the headers installation is skipped or not."

find_path(RS_CORE_LIB_INCLUDE_DIR rs-core/common.hpp)
#find_library(RW_UTILITIES_LIBRARY NAMES rw_utilities)
find_package(ZLIB REQUIRED)
find_library(PCRE2_LIBRARY_DEBUG NAMES pcre2-8d HINTS ${INSTALLED_LIB_PATH})
find_library(PCRE2_LIBRARY_RELEASE NAMES pcre2-8 HINTS ${INSTALLED_LIB_PATH})
select_library_configurations(PCRE2)

file(GLOB_RECURSE UNICORN_LIB_SOURCES ${PROJECT_SOURCE_DIR}/unicorn/*.cpp)
foreach(ITR ${UNICORN_LIB_SOURCES})
Expand All @@ -24,7 +28,14 @@ target_compile_definitions(
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 DESTINATION lib)
install(TARGETS unicorn-lib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
2 changes: 1 addition & 1 deletion ports/unicorn-lib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: unicorn-lib
Version: 2019-05-07
Version: 2019-05-07-1
Description: Unicode library for C++ by Ross Smith
Build-Depends: rs-core-lib, pcre2, zlib, libiconv
7 changes: 7 additions & 0 deletions ports/unicorn-lib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
include(vcpkg_common_functions)

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
Expand All @@ -20,5 +25,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/unicorn-lib RENAME copyright)