mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 02:19:00 +08:00
[new port] Add openctm (#24680)
* New port: openctm * Change openctm from "version-semver" to "version" Co-authored-by: Frank <65999885+FrankXie05@users.noreply.github.com> * Update openctm versions file * Use ${PORT} instead of openctm directly * Put CMake configs in the unofficial namespace. * dos2unix Co-authored-by: Frank <65999885+FrankXie05@users.noreply.github.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
parent
2247b397fa
commit
68c6835c82
60
ports/openctm/CMakeLists.txt
Normal file
60
ports/openctm/CMakeLists.txt
Normal file
@ -0,0 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.19...3.23)
|
||||
project(
|
||||
openctm
|
||||
VERSION 1.0.3
|
||||
LANGUAGES C)
|
||||
|
||||
set(PUBLIC_HEADERS lib/openctm.h lib/openctmpp.h)
|
||||
|
||||
add_library(
|
||||
openctm
|
||||
lib/compressMG1.c
|
||||
lib/compressMG2.c
|
||||
lib/compressRAW.c
|
||||
lib/openctm.c
|
||||
lib/stream.c
|
||||
lib/liblzma/Alloc.c
|
||||
lib/liblzma/LzFind.c
|
||||
lib/liblzma/LzmaDec.c
|
||||
lib/liblzma/LzmaEnc.c
|
||||
lib/liblzma/LzmaLib.c)
|
||||
|
||||
target_include_directories(
|
||||
openctm
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/lib>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/lib/liblzma>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
target_compile_definitions(openctm PRIVATE OPENCTM_BUILD LZMA_PREFIX_CTM)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(openctm PUBLIC OPENCTM_STATIC)
|
||||
endif()
|
||||
target_compile_features(openctm PRIVATE c_std_99)
|
||||
set_target_properties(openctm PROPERTIES C_VISIBILITY_PRESET hidden
|
||||
PUBLIC_HEADER "${PUBLIC_HEADERS}")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(
|
||||
TARGETS openctm
|
||||
EXPORT unofficial-openctmConfig
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT dev)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
set(VERSION_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/unofficial-openctmConfigVersion.cmake")
|
||||
write_basic_package_version_file(
|
||||
"${VERSION_FILE_PATH}"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
install(FILES "${VERSION_FILE_PATH}" DESTINATION share/unofficial-openctm)
|
||||
|
||||
install(FILES ${PUBLIC_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
install(
|
||||
EXPORT unofficial-openctmConfig
|
||||
FILE unofficial-openctmConfig.cmake
|
||||
NAMESPACE unofficial::openctm::
|
||||
DESTINATION share/unofficial-openctm)
|
||||
|
||||
export(PACKAGE openctm)
|
21
ports/openctm/portfile.cmake
Normal file
21
ports/openctm/portfile.cmake
Normal file
@ -0,0 +1,21 @@
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO openctm
|
||||
REF OpenCTM-1.0.3
|
||||
SHA512 fdfa08d19ecbfea99ba01aa2032e941ed6313394a96bd69f8984c2d2d079d836c616471d2bdf6f40175e75659f3ad0ba41502bc3d8224091472f40893ea8746e
|
||||
FILENAME "OpenCTM-1.0.3-src.tar.bz2"
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openctm)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
17
ports/openctm/vcpkg.json
Normal file
17
ports/openctm/vcpkg.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "openctm",
|
||||
"version": "1.0.3",
|
||||
"description": "OpenCTM — the Open Compressed Triangle Mesh file format — is a file format, a software library and a tool set for compression of 3D triangle meshes.",
|
||||
"homepage": "http://openctm.sourceforge.net/",
|
||||
"license": "Zlib",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
@ -5100,6 +5100,10 @@
|
||||
"baseline": "1.4.2",
|
||||
"port-version": 2
|
||||
},
|
||||
"openctm": {
|
||||
"baseline": "1.0.3",
|
||||
"port-version": 0
|
||||
},
|
||||
"opencv": {
|
||||
"baseline": "4.5.5",
|
||||
"port-version": 0
|
||||
|
9
versions/o-/openctm.json
Normal file
9
versions/o-/openctm.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "ea30144a8ad57cb95b0603de14e4dc8e9f7b2ea2",
|
||||
"version": "1.0.3",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user