2020-07-14 04:37:29 +08:00
|
|
|
set(VERSION 8.1)
|
2018-09-05 07:20:46 +08:00
|
|
|
|
|
|
|
# Note: upstream GitLab instance at https://graphics.rwth-aachen.de:9000 often goes down
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://www.openmesh.org/media/Releases/${VERSION}/OpenMesh-${VERSION}.tar.gz"
|
|
|
|
FILENAME "OpenMesh-${VERSION}.tar.gz"
|
2020-07-14 04:37:29 +08:00
|
|
|
SHA512 c146e6b21d709a31772621a6a913def93a51460c4abb950c2eb64eea4528c7efd4c86166ba56ae0bc8090cc5878dd9328b570e094e61c1b64d6d298de05aca61
|
2018-09-05 07:20:46 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
2018-05-15 00:53:12 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2018-09-05 07:20:46 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
|
|
|
REF "${VERSION}"
|
2018-03-14 22:24:39 +08:00
|
|
|
)
|
|
|
|
|
2020-06-24 04:12:14 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(OPENMESH_BUILD_SHARED ON)
|
|
|
|
else()
|
|
|
|
set(OPENMESH_BUILD_SHARED OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-03-14 22:24:39 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2020-07-14 04:37:29 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
2020-06-24 04:12:14 +08:00
|
|
|
-DBUILD_APPS=OFF
|
|
|
|
-DOPENMESH_BUILD_SHARED=${OPENMESH_BUILD_SHARED}
|
|
|
|
# [TODO]: add apps as feature, requires qt5 and freeglut
|
2018-03-14 22:24:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
2020-07-14 04:37:29 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/OpenMesh/cmake TARGET_PATH share/OpenMesh/cmake)
|
2018-03-14 22:24:39 +08:00
|
|
|
|
2021-11-04 12:46:49 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/libdata/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/libdata/pkgconfig" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
|
|
|
|
endif()
|
2021-10-27 07:03:33 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/libdata" "${CURRENT_PACKAGES_DIR}/libdata")
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2018-03-14 22:24:39 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/OpenMesh/Tools/VDPM/xpm)
|
2020-06-24 04:12:14 +08:00
|
|
|
# Only move dynamic libraries to bin on Windows
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2021-11-04 12:46:49 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
2020-06-24 04:12:14 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/OpenMeshCore.dll ${CURRENT_PACKAGES_DIR}/bin/OpenMeshCore.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/OpenMeshTools.dll ${CURRENT_PACKAGES_DIR}/bin/OpenMeshTools.dll)
|
2021-11-04 12:46:49 +08:00
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2020-06-24 04:12:14 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/OpenMeshCored.dll ${CURRENT_PACKAGES_DIR}/debug/bin/OpenMeshCored.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/OpenMeshToolsd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/OpenMeshToolsd.dll)
|
2021-11-04 12:46:49 +08:00
|
|
|
endif()
|
2020-06-24 04:12:14 +08:00
|
|
|
endif()
|
2018-03-14 22:24:39 +08:00
|
|
|
|
2020-06-24 04:12:14 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY)
|
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
2018-03-14 22:24:39 +08:00
|
|
|
# Handle copyright
|
2020-06-24 04:12:14 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|