[yoga] Add unofficial-yoga-config.cmake (#25417)

* [yoga] Add unofficial-yoga-config.cmake

* x-add-version

Co-authored-by: Cheney-Wang <v-xincwa@microsoft.com>
This commit is contained in:
Cheney Wang 2022-07-06 06:52:53 +08:00 committed by GitHub
parent 06d29adda9
commit 517adc7517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 30 deletions

View File

@ -0,0 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6f4a83..7cee74a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,26 @@ add_compile_options(
file(GLOB_RECURSE yogacore_SRC yoga/*.cpp)
add_library(yogacore STATIC ${yogacore_SRC})
-target_include_directories(yogacore PUBLIC .)
+target_include_directories(yogacore PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+)
target_link_libraries(yogacore android log)
set_target_properties(yogacore PROPERTIES CXX_STANDARD 11)
+
+install(TARGETS yogacore EXPORT unofficial-yoga-config
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+install(EXPORT unofficial-yoga-config
+ FILE unofficial-yoga-config.cmake
+ NAMESPACE unofficial::yoga::
+ DESTINATION share/unofficial-yoga
+)
+
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/yoga
+ DESTINATION include
+ FILES_MATCHING
+ PATTERN *.h
+)
\ No newline at end of file

View File

@ -6,38 +6,19 @@ vcpkg_from_github(
REF v1.19.0
SHA512 B1CB1F23CF9B5DD2491B6883CAF8FB47E264B736C94F6AA6655E9A6F641664B4BCEEB48F74C98B955F0EE02BA2E0AE8E01539A928ABB4B81FAE13ED3B57287CA
HEAD_REF master
PATCHES add-project-declaration.patch
PATCHES
add-project-declaration.patch
Export-unofficial-yoga-config.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_build_cmake()
vcpkg_copy_pdbs()
vcpkg_cmake_install()
file(INSTALL ${SOURCE_PATH}/yoga DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-yoga)
set(YOGA_LIB_PREFFIX )
if (NOT VCPKG_TARGET_IS_WINDOWS)
set(YOGA_LIB_PREFFIX lib)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(YOGA_BINARY_PATH )
if (VCPKG_TARGET_IS_WINDOWS)
set(YOGA_BINARY_PATH Release/)
endif()
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${YOGA_BINARY_PATH}${YOGA_LIB_PREFFIX}yogacore${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(YOGA_BINARY_PATH )
if (VCPKG_TARGET_IS_WINDOWS)
set(YOGA_BINARY_PATH Debug/)
endif()
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${YOGA_BINARY_PATH}${YOGA_LIB_PREFFIX}yogacore${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,7 +1,19 @@
{
"name": "yoga",
"version": "1.19.0",
"port-version": 1,
"description": "Yoga is a cross-platform layout engine which implements Flexbox",
"homepage": "https://github.com/facebook/yoga",
"supports": "!uwp"
"license": "MIT",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -7775,7 +7775,7 @@
},
"yoga": {
"baseline": "1.19.0",
"port-version": 0
"port-version": 1
},
"yomm2": {
"baseline": "1.1.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "620d91442f1a5e599eeabcb0c6b86fcb57a781f8",
"version": "1.19.0",
"port-version": 1
},
{
"git-tree": "12751eb94758566f26b621b28dc86fe8b1977a7f",
"version": "1.19.0",