Package the polyscope project with vcpkg #41001
Replies: 2 comments
-
I manually downloaded these submodule files and moved them to the target directory, which at least solved the problem. However, when building as a dynamic library, polyscope needs to link to various dependent libraries. I am not very proficient in cmake and don't know how to modify this. If it involves modifying polyscope/cmakelists.txt, I think I can use patch files to modify it non-invasively. Note that I have only solved the problem of downloading submodules and preliminary building. I have not yet performed the final complete build, so I am not sure whether the deployment of pdb, etc. is correct. vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nmwsharp/polyscope
REF "v${VERSION}"
SHA512 4d8c6ab5488059e3cbc77e2ce51043edd9e19919b8b50b27ec7c448cbf1c93ba1f2c5331b7772c243c67d243043fe39f21374968fbe0b6b05d308318e55dbe97
HEAD_REF master
)
vcpkg_from_github(
OUT_SOURCE_PATH GLFW_SUBMODULE_PATH
REPO glfw/glfw
REF e2c9264
SHA512 ead18e7c9188dd4c152cc9ea5ee06a137ced958d273224086e306bb469ebd170c5c86ecac33755fddfebe1fa5f5f48f02fd081bb6df74460731778fbaa4dce4b
)
vcpkg_from_github(
OUT_SOURCE_PATH GLM_SUBMODULE_PATH
REPO g-truc/glm
REF 0af55cc
SHA512 f66bf7f419b4458dd10524dc96fa2b5651374cf80ac198566ed0a80e6f66fc0cbeb6010edf0f984c4c415e84289b64002f664c6b43c00d39e9d92389b321696d
)
vcpkg_from_github(
OUT_SOURCE_PATH HAPPLY_SUBMODULE_PATH
REPO nmwsharp/happly
REF 88f7972
SHA512 79f2be2d4f5583bc4ea63d92af142fc1a59c91610dee5d2bbbd3fbfb6ff6cd697cd6cc6d740ac3878278257f550c739832b2ecf10887b0607045e9f09a35c92c
)
vcpkg_from_github(
OUT_SOURCE_PATH IMGUI_SUBMODULE_PATH
REPO ocornut/imgui
REF 277ae93
SHA512 3f8cde363f3a5160419db602fba8246dbcfba9639df097b72186233d83a4c72ea6cfdc27d30445e8556b6e3866246cd96c05c3ae701b9ec4e1f388d1b52e0c9d
)
file(INSTALL "${GLFW_SUBMODULE_PATH}/" DESTINATION "${SOURCE_PATH}/deps/glfw" FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
file(INSTALL "${GLM_SUBMODULE_PATH}/" DESTINATION "${SOURCE_PATH}/deps/glm" FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
file(INSTALL "${HAPPLY_SUBMODULE_PATH}/" DESTINATION "${SOURCE_PATH}/deps/happly" FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
file(INSTALL "${IMGUI_SUBMODULE_PATH}/" DESTINATION "${SOURCE_PATH}/deps/imgui/imgui" FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_install_cmake()
vcpkg_cmake_config_fixup(PACKAGE_NAME "polyscope")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
vcpkg_copy_pdbs() |
Beta Was this translation helpful? Give feedback.
-
If all dependencies of polyscope are to be changed to vcpkg, I think more work will need to be done on the build script of polyscope. At least some issues from a long time ago do not seem to have made much obvious progress. |
Beta Was this translation helpful? Give feedback.
-
I try to use vcpkg to build my project. I need the polyscope project to run my code. However, this project is not in vcpkg's repo. So I try to package it by myself. I try to follow the tutorial from Tutorial: Package a library with vcpkg but meet some problems.
This is my workspace folder tree
This is portfile.cmake content
This is vcpkg.json content
Then I
vcpkg install polyscope --overlay-ports=/path/to/custom-overlay
then get the error belowThis is my guess:
The project
polyscope
has three submodules in deps folder. When vcpkg downloadspolyscope
project, the submodules are not downloaded. So when itadd_subdirectory()
them, error occur.How to deal with it ? I'm new to use package management tools.
Beta Was this translation helpful? Give feedback.
All reactions