[libzen] Add new port (#7004)

This commit is contained in:
Maxime Gervais 2019-06-26 06:44:17 +02:00 committed by Robert Schumacher
parent 7401e2ff64
commit abb7f546de
3 changed files with 65 additions and 0 deletions

3
ports/libzen/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: libzen
Version: 0.4.37
Description: ZenLib is a C++ utility library for easiest cross-platform development

View File

@ -0,0 +1,31 @@
include(vcpkg_common_functions)
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO MediaArea/ZenLib
REF v0.4.37
SHA512 857091422d6425aeae59bf5a9dfedd72f5c9b4a18f29acf88842d812f2b470fc8b1b03a245af6b7d08d616dd5596a8905cc138daecee23dadea39ae4215f77d4
HEAD_REF master
PATCHES vcpkg_support_in_cmakelists.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/Project/CMake
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/zenlib TARGET_PATH share/zenlib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/libzen RENAME copyright)
vcpkg_test_cmake(PACKAGE_NAME ZenLib MODULE)

View File

@ -0,0 +1,31 @@
diff --git a/Project/CMake/CMakeLists.txt b/Project/CMake/CMakeLists.txt
index cb96dc8..8b05a25 100644
--- a/Project/CMake/CMakeLists.txt
+++ b/Project/CMake/CMakeLists.txt
@@ -33,10 +33,12 @@ set(BIN_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE STRING "Directory where
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE STRING "Directory where library will install")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}" CACHE PATH "The directory the headers are installed in")
-if(NOT MSVC)
- set(ZenLib_CONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/zenlib")
+if(VCPKG_TARGET_TRIPLET)
+ set(ZenLib_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/zenlib")
+elseif(MSVC)
+ set(ZenLib_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
else()
- set(ZenLib_CONFIG_INSTALL_DIR "cmake")
+ set(ZenLib_CONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/zenlib")
endif()
set(ZenLib_HDRS
@@ -136,10 +138,6 @@ set_target_properties(zen PROPERTIES
PUBLIC_HEADER "${ZenLib_HDRS}"
)
-if(MSVC)
- install(FILES $<TARGET_PDB_FILE:zen> DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS "Debug;RelWithDebInfo" OPTIONAL)
-endif()
-
install(TARGETS zen EXPORT zen-export
PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/ZenLib
RUNTIME DESTINATION ${BIN_INSTALL_DIR}