2021-05-18 15:50:59 +08:00
|
|
|
set(EMBREE3_VERSION 3.12.2)
|
|
|
|
|
2018-08-14 06:36:55 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO embree/embree
|
2021-05-18 15:50:59 +08:00
|
|
|
REF v${EMBREE3_VERSION}
|
|
|
|
SHA512 a63b483a92f4653e07a21ed3b545d86003295e0aacd8ec7a40ee72bad7bb70c6ea019af511e78c5c598336b162d53e296e9c87150c0adce6463b058e7a5394d4
|
2018-08-14 06:36:55 +08:00
|
|
|
HEAD_REF master
|
2019-09-17 04:15:56 +08:00
|
|
|
PATCHES
|
2020-08-10 04:16:00 +08:00
|
|
|
fix-path.patch
|
2020-08-29 06:37:42 +08:00
|
|
|
fix-static-usage.patch
|
2021-05-20 05:05:43 +08:00
|
|
|
cmake_policy.patch
|
2021-06-02 02:07:16 +08:00
|
|
|
fix-targets-file-not-found.patch
|
2017-07-22 19:28:16 +08:00
|
|
|
)
|
|
|
|
|
2020-08-10 04:16:00 +08:00
|
|
|
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static EMBREE_STATIC_LIB)
|
|
|
|
string(COMPARE EQUAL ${VCPKG_CRT_LINKAGE} static EMBREE_STATIC_RUNTIME)
|
2019-09-17 04:15:56 +08:00
|
|
|
|
2021-05-18 15:50:59 +08:00
|
|
|
if (NOT VCPKG_TARGET_IS_OSX)
|
|
|
|
if ("avx512" IN_LIST FEATURES)
|
|
|
|
message(FATAL_ERROR "Microsoft Visual C++ Compiler does not support feature avx512 officially.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2021-06-02 02:07:16 +08:00
|
|
|
avx EMBREE_ISA_AVX
|
|
|
|
avx2 EMBREE_ISA_AVX2
|
|
|
|
avx512 EMBREE_ISA_AVX512
|
|
|
|
sse2 EMBREE_ISA_SSE2
|
|
|
|
sse42 EMBREE_ISA_SSE42
|
2021-05-18 15:50:59 +08:00
|
|
|
)
|
|
|
|
elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
list(LENGTH FEATURES FEATURE_COUNT)
|
|
|
|
if (FEATURE_COUNT GREATER 2)
|
|
|
|
message(WARNING [[
|
|
|
|
Using Embree as static library is not supported with AppleClang >= 9.0 when multiple ISAs are selected.
|
|
|
|
Please install embree3 with only one feature using command "./vcpkg install embree3[core,FEATURE_NAME]"
|
|
|
|
Only set feature avx automaticlly.
|
|
|
|
]])
|
|
|
|
set(FEATURE_OPTIONS
|
|
|
|
-DEMBREE_ISA_AVX=ON
|
|
|
|
-DEMBREE_ISA_AVX2=OFF
|
|
|
|
-DEMBREE_ISA_AVX512=OFF
|
|
|
|
-DEMBREE_ISA_SSE2=OFF
|
|
|
|
-DEMBREE_ISA_SSE42=OFF
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-09-28 07:17:12 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-04-15 19:47:54 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2021-05-18 15:50:59 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2017-07-22 19:28:16 +08:00
|
|
|
-DEMBREE_ISPC_SUPPORT=OFF
|
|
|
|
-DEMBREE_TUTORIALS=OFF
|
|
|
|
-DEMBREE_STATIC_RUNTIME=${EMBREE_STATIC_RUNTIME}
|
2019-09-17 04:15:56 +08:00
|
|
|
-DEMBREE_STATIC_LIB=${EMBREE_STATIC_LIB}
|
2017-07-22 19:28:16 +08:00
|
|
|
)
|
|
|
|
|
2022-09-28 07:17:12 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-07-22 19:28:16 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2022-09-28 07:17:12 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME embree)
|
2017-07-22 19:28:16 +08:00
|
|
|
|
2021-06-02 02:07:16 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2021-05-18 15:50:59 +08:00
|
|
|
|
2020-01-17 14:56:33 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2021-06-02 02:07:16 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2020-01-17 14:56:33 +08:00
|
|
|
endif()
|
2020-08-10 04:16:00 +08:00
|
|
|
if(APPLE)
|
2021-06-02 02:07:16 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/uninstall.command" "${CURRENT_PACKAGES_DIR}/debug/uninstall.command")
|
2020-01-17 14:56:33 +08:00
|
|
|
endif()
|
2021-06-02 02:07:16 +08:00
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc" "${CURRENT_PACKAGES_DIR}/share/${PORT}/")
|
2017-07-22 19:28:16 +08:00
|
|
|
|
2021-06-02 02:07:16 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-09-28 07:17:12 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|