[opencascade] Fix the paths in target files for static build (#31460)

* [opencascade] Fix paths in target files for static build

* update version

* apply suggestion

* update version
This commit is contained in:
Lily Wang 2023-05-17 23:57:42 +08:00 committed by GitHub
parent 2d18711ce2
commit b49c204b93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 12 deletions

View File

@ -11,7 +11,7 @@ vcpkg_from_github(
fix-depend-freetype.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(BUILD_TYPE "Shared")
else()
set(BUILD_TYPE "Static")
@ -77,11 +77,7 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
# debug creates libd and bind directories that need moving
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bind" "${CURRENT_PACKAGES_DIR}/debug/bin")
if (NOT VCPKG_BUILD_TYPE)
# fix paths in target files
list(APPEND TARGET_FILES
"${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEApplicationFrameworkTargets-debug.cmake"
@ -92,14 +88,21 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
"${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEModelingDataTargets-debug.cmake"
"${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEVisualizationTargets-debug.cmake"
)
foreach(TARGET_FILE IN LISTS TARGET_FILES)
file(READ "${TARGET_FILE}" filedata)
string(REGEX REPLACE "libd" "lib" filedata "${filedata}")
string(REGEX REPLACE "bind" "bin" filedata "${filedata}")
string(REGEX REPLACE "/libd" "/lib" filedata "${filedata}")
string(REGEX REPLACE "/bind" "/bin" filedata "${filedata}")
file(WRITE "${TARGET_FILE}" "${filedata}")
endforeach()
endif()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
# debug creates libd and bind directories that need moving
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bind" "${CURRENT_PACKAGES_DIR}/debug/bin")
# the bin directory ends up with bat files that are noise, let's clean that up
file(GLOB BATS "${CURRENT_PACKAGES_DIR}/bin/*.bat")
file(REMOVE_RECURSE ${BATS})
@ -108,4 +111,4 @@ else()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(INSTALL "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt")

View File

@ -1,7 +1,7 @@
{
"name": "opencascade",
"version": "7.6.2",
"port-version": 2,
"port-version": 3,
"description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.",
"homepage": "https://github.com/Open-Cascade-SAS/OCCT",
"license": "LGPL-2.1",

View File

@ -5838,7 +5838,7 @@
},
"opencascade": {
"baseline": "7.6.2",
"port-version": 2
"port-version": 3
},
"opencc": {
"baseline": "1.1.6",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3bf7c68565ee022f685f20eb18bb2e38cfdffb17",
"version": "7.6.2",
"port-version": 3
},
{
"git-tree": "58939d51b0f33a014e48f1d7100ab8888d068c2d",
"version": "7.6.2",