2024-02-23 11:56:52 +08:00
|
|
|
# The bulk of the external dependencies are now automatically downlaoded and built using vcpkg.
|
2023-07-26 21:11:10 +08:00
|
|
|
|
2024-02-23 11:56:52 +08:00
|
|
|
if (WIN32)
|
|
|
|
|
set(EXTERN_LIB_SUFFIX "lib")
|
|
|
|
|
set(EXTERN_LIB_PREFIX "")
|
|
|
|
|
else()
|
|
|
|
|
set(EXTERN_LIB_SUFFIX "a")
|
|
|
|
|
set(EXTERN_LIB_PREFIX "lib")
|
2023-08-04 16:26:18 +08:00
|
|
|
endif()
|
2021-02-28 19:51:57 +08:00
|
|
|
|
2024-02-23 11:56:52 +08:00
|
|
|
add_library(include_helpers INTERFACE)
|
|
|
|
|
target_include_directories(include_helpers INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
|
2021-03-03 03:22:02 +08:00
|
|
|
|
2021-08-17 14:14:32 +08:00
|
|
|
add_library(earcut INTERFACE)
|
2024-02-23 11:56:52 +08:00
|
|
|
find_path(EARCUT_HPP_INCLUDE_DIRS "mapbox/earcut.hpp")
|
|
|
|
|
target_include_directories(earcut INTERFACE "${EARCUT_HPP_INCLUDE_DIRS}")
|
2024-02-23 06:08:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-23 11:56:52 +08:00
|
|
|
# Modp_b64 doesn't contain a CMake config, so we construct a fake import library here
|
|
|
|
|
add_library(modp_b64::modp_b64 STATIC IMPORTED GLOBAL)
|
|
|
|
|
set_target_properties(modp_b64::modp_b64 PROPERTIES
|
2024-08-24 00:31:11 +08:00
|
|
|
INCLUDE_DIRECTORIES "${PACKAGE_BUILD_DIR}/include"
|
2024-02-23 11:56:52 +08:00
|
|
|
# Yes, on non-windows platforms the name of the library really is liblibmodpbase64.a
|
|
|
|
|
# Don't ask me, I didn't do it.
|
2024-08-24 00:31:11 +08:00
|
|
|
IMPORTED_LOCATION "${PACKAGE_BUILD_DIR}/lib/${EXTERN_LIB_PREFIX}libmodpbase64.${EXTERN_LIB_SUFFIX}"
|
|
|
|
|
IMPORTED_LOCATION_DEBUG "${PACKAGE_BUILD_DIR}/debug/lib/${EXTERN_LIB_PREFIX}libmodpbase64.${EXTERN_LIB_SUFFIX}"
|
2024-02-23 06:08:15 +08:00
|
|
|
)
|
|
|
|
|
|
2024-02-23 11:56:52 +08:00
|
|
|
# picosha2 also doesn't contain a CMake config, so we construct a fake header-only import library here
|
|
|
|
|
add_library(picosha2::picosha2 IMPORTED INTERFACE GLOBAL)
|
|
|
|
|
set_target_properties(picosha2::picosha2 PROPERTIES
|
2024-08-24 00:31:11 +08:00
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_BUILD_DIR}/include"
|
2024-02-23 06:08:15 +08:00
|
|
|
)
|
|
|
|
|
|
2024-08-24 00:31:11 +08:00
|
|
|
find_library(ZLIB_NG_RELEASE_LIB NAMES zlibstatic-ng z-ng PATHS ${PACKAGE_BUILD_DIR}/lib NO_DEFAULT_PATH)
|
|
|
|
|
find_library(ZLIB_NG_DEBUG_LIB NAMES zlibstatic-ngd z-ng PATHS ${PACKAGE_BUILD_DIR}/debug/lib NO_DEFAULT_PATH)
|
2024-02-23 11:56:52 +08:00
|
|
|
add_library(zlib-ng::zlib-ng STATIC IMPORTED GLOBAL)
|
2024-08-24 00:31:11 +08:00
|
|
|
target_include_directories(zlib-ng::zlib-ng INTERFACE "${PACKAGE_BUILD_DIR}/include")
|
2024-02-23 11:56:52 +08:00
|
|
|
set_target_properties(zlib-ng::zlib-ng PROPERTIES
|
|
|
|
|
IMPORTED_LOCATION "${ZLIB_NG_RELEASE_LIB}"
|
|
|
|
|
IMPORTED_LOCATION_DEBUG "${ZLIB_NG_DEBUG_LIB}"
|
2023-03-01 13:11:27 +08:00
|
|
|
)
|