2017-07-20 09:12:19 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO assimp/assimp
|
2024-04-12 22:40:39 +08:00
|
|
|
REF "v${VERSION}"
|
2024-07-08 22:18:04 +08:00
|
|
|
SHA512 4bfcc3a1b5a0cf3f382560564cac67088e13c62500c3c77dcef03811e67debe72ff318f5ed145b204d5017b56cb4293f3fe14b4060ca193813cef42b12eebe9d
|
2017-07-20 09:12:19 +08:00
|
|
|
HEAD_REF master
|
2017-11-01 16:54:16 +08:00
|
|
|
PATCHES
|
2020-09-10 11:40:15 +08:00
|
|
|
build_fixes.patch
|
2017-08-24 17:55:25 +08:00
|
|
|
)
|
|
|
|
|
2022-07-07 06:00:23 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake-modules/FindZLIB.cmake")
|
|
|
|
|
2023-09-29 14:29:58 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/clipper")
|
2022-07-07 06:00:23 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/draco")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/gtest")
|
|
|
|
#file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/Open3DGC") #TODO
|
|
|
|
#file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/openddlparser") #TODO
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/poly2tri")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/pugixml")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/rapidjson")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/stb")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/unzip")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/utf8cpp")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/zip")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/zlib")
|
2018-08-09 01:11:51 +08:00
|
|
|
|
2017-11-05 05:54:12 +08:00
|
|
|
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
|
|
|
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
2017-11-01 16:54:16 +08:00
|
|
|
|
2022-07-07 06:00:23 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
-DASSIMP_BUILD_ZLIB=OFF
|
|
|
|
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
|
|
|
|
-DASSIMP_BUILD_TESTS=OFF
|
|
|
|
-DASSIMP_WARNINGS_AS_ERRORS=OFF
|
|
|
|
-DASSIMP_IGNORE_GIT_HASH=ON
|
|
|
|
-DASSIMP_INSTALL_PDB=OFF
|
2016-10-06 07:00:17 +08:00
|
|
|
)
|
|
|
|
|
2022-07-07 06:00:23 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/assimp")
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
2020-10-17 17:10:11 +08:00
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-07-07 06:00:23 +08:00
|
|
|
set(VCVER vc140 vc141 vc142 vc143)
|
2020-10-17 17:10:11 +08:00
|
|
|
set(CRT mt md)
|
|
|
|
set(DBG_NAMES)
|
|
|
|
set(REL_NAMES)
|
|
|
|
foreach(_ver IN LISTS VCVER)
|
|
|
|
foreach(_crt IN LISTS CRT)
|
|
|
|
list(APPEND DBG_NAMES assimp-${_ver}-${_crt}d)
|
|
|
|
list(APPEND REL_NAMES assimp-${_ver}-${_crt})
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2023-09-29 14:29:58 +08:00
|
|
|
find_library(ASSIMP_REL NAMES assimp ${REL_NAMES} PATHS "${CURRENT_PACKAGES_DIR}/lib" NO_DEFAULT_PATH)
|
2020-10-17 17:10:11 +08:00
|
|
|
find_library(ASSIMP_DBG NAMES assimp assimpd ${DBG_NAMES} PATHS "${CURRENT_PACKAGES_DIR}/debug/lib" NO_DEFAULT_PATH)
|
|
|
|
if(ASSIMP_REL)
|
|
|
|
get_filename_component(ASSIMP_NAME_REL "${ASSIMP_REL}" NAME_WLE)
|
2023-09-29 14:29:58 +08:00
|
|
|
string(REGEX REPLACE "^lib(.*)" "\\1" ASSIMP_NAME_REL "${ASSIMP_NAME_REL}")
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/assimp.pc" "-lassimp" "-l${ASSIMP_NAME_REL}" IGNORE_UNCHANGED)
|
2020-10-17 17:10:11 +08:00
|
|
|
endif()
|
|
|
|
if(ASSIMP_DBG)
|
|
|
|
get_filename_component(ASSIMP_NAME_DBG "${ASSIMP_DBG}" NAME_WLE)
|
2023-09-29 14:29:58 +08:00
|
|
|
string(REGEX REPLACE "^lib(.*)" "\\1" ASSIMP_NAME_DBG "${ASSIMP_NAME_DBG}")
|
2020-10-17 17:10:11 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/assimp.pc" "-lassimp" "-l${ASSIMP_NAME_DBG}")
|
|
|
|
endif()
|
2023-09-29 14:29:58 +08:00
|
|
|
|
|
|
|
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
|
|
|
|
set(assimp_PC_REQUIRES "draco polyclipping pugixml minizip")
|
|
|
|
set(assimp_LIBS_REQUIRES "-lpoly2tri")
|
|
|
|
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/assimp.pc" "Libs:" "Requires.private: ${assimp_PC_REQUIRES}\nLibs:")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/assimp.pc" "Libs.private:" "Libs.private: ${assimp_LIBS_REQUIRES}")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/assimp.pc" "Libs:" "Requires.private: ${assimp_PC_REQUIRES}\nLibs:")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/assimp.pc" "Libs.private:" "Libs.private: ${assimp_LIBS_REQUIRES}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-09-10 11:40:15 +08:00
|
|
|
|
2022-07-07 06:00:23 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2016-10-06 07:00:17 +08:00
|
|
|
|
2023-09-29 14:29:58 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|