mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[openfbx] Add port (#26678)
* [openfbx] Add port * Set cxx standard to 11 to fix osx build * version * [openfbx] add unofficial namespace * [openfbx] fixes for unofficial-openfbx * [openfbx] more renaming * [openfbx] fix after unofficial renaming * [openfbx] Make it static only as it doesn't export any symbols Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
This commit is contained in:
parent
793fd2bff1
commit
3bc4cc846b
48
ports/openfbx/CMakeLists.txt
Normal file
48
ports/openfbx/CMakeLists.txt
Normal file
@ -0,0 +1,48 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(OpenFBX LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
find_package(miniz REQUIRED)
|
||||
|
||||
add_library(openfbx src/ofbx.cpp)
|
||||
target_link_libraries(openfbx PRIVATE miniz::miniz)
|
||||
|
||||
target_include_directories(openfbx
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/>)
|
||||
|
||||
target_compile_definitions(openfbx PRIVATE _LARGEFILE64_SOURCE)
|
||||
|
||||
install(TARGETS openfbx EXPORT unofficial-openfbxTargets
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
INCLUDES DESTINATION include)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
unofficial-openfbxConfig.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/unofficial-openfbxConfig.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/unofficial-openfbx"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-openfbxConfig.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/unofficial-openfbx"
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/src/ofbx.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT unofficial-openfbxTargets
|
||||
NAMESPACE unoffical::openfbx::
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/unofficial-openfbx
|
||||
)
|
25
ports/openfbx/portfile.cmake
Normal file
25
ports/openfbx/portfile.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO nem0/OpenFBX
|
||||
REF 6a788af3b19dd6921a64eb7e133a3fa131dfbbd5
|
||||
SHA512 c441e15ef0916e412af464c9f318a471cdbdc55225fe4282ff640243cd11dfcac6ff233ae8e60db63d1eaed1511d33ffa8d7ed37743c4580f8bde0724d7b6c47
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-openfbxConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openfbx)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
8
ports/openfbx/unofficial-openfbxConfig.cmake.in
Normal file
8
ports/openfbx/unofficial-openfbxConfig.cmake.in
Normal file
@ -0,0 +1,8 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(miniz)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-openfbxTargets.cmake")
|
||||
|
||||
check_required_components(miniz)
|
18
ports/openfbx/vcpkg.json
Normal file
18
ports/openfbx/vcpkg.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "openfbx",
|
||||
"version-date": "2022-07-18",
|
||||
"description": "Lightweight open source FBX importer",
|
||||
"homepage": "https://github.com/nem0/OpenFBX",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
"miniz",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
@ -5312,6 +5312,10 @@
|
||||
"baseline": "2.5.8",
|
||||
"port-version": 1
|
||||
},
|
||||
"openfbx": {
|
||||
"baseline": "2022-07-18",
|
||||
"port-version": 0
|
||||
},
|
||||
"opengl": {
|
||||
"baseline": "2022-03-14",
|
||||
"port-version": 1
|
||||
|
9
versions/o-/openfbx.json
Normal file
9
versions/o-/openfbx.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "2ef566bee77c87c4efa26b8c9905e1fb26117f95",
|
||||
"version-date": "2022-07-18",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user