2019-06-22 13:45:40 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2021-02-09 10:18:42 +08:00
|
|
|
URLS "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.5.tar.bz2"
|
|
|
|
FILENAME "libftdi1-1.5.tar.bz2"
|
|
|
|
SHA512 c525b2ab6aff9ef9254971ae7d57f3549a36a36875765c48f947d52532814a2a004de1232389d4fe824a8c8ab84277b08427308573476e1da9b7db83db802f6f
|
2019-06-22 13:45:40 +08:00
|
|
|
)
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2024-09-13 10:28:25 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2023-04-14 00:13:15 +08:00
|
|
|
SOURCE_BASE 1.5
|
2019-06-22 13:45:40 +08:00
|
|
|
PATCHES
|
2024-09-13 10:28:25 +08:00
|
|
|
cmake-version.diff
|
|
|
|
disable-config-script.diff
|
|
|
|
linkage.diff
|
|
|
|
libdir.diff
|
|
|
|
libftdipp1.diff
|
|
|
|
libusb.diff
|
2019-06-22 13:45:40 +08:00
|
|
|
)
|
|
|
|
|
2021-11-06 03:55:49 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}/src")
|
2019-06-22 13:45:40 +08:00
|
|
|
|
2024-09-13 10:28:25 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATICLIBS)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS options
|
|
|
|
FEATURES
|
|
|
|
cpp FTDIPP
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
|
2021-11-06 03:55:49 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-06-22 13:45:40 +08:00
|
|
|
OPTIONS
|
2024-09-13 10:28:25 +08:00
|
|
|
${options}
|
2019-06-22 13:45:40 +08:00
|
|
|
-DBUILD_TESTS=OFF
|
2024-09-13 10:28:25 +08:00
|
|
|
-DCMAKE_CXX_STANDARD=11
|
2019-06-22 13:45:40 +08:00
|
|
|
-DDOCUMENTATION=OFF
|
|
|
|
-DEXAMPLES=OFF
|
2021-02-09 10:18:42 +08:00
|
|
|
-DFTDI_EEPROM=OFF
|
2024-09-13 10:28:25 +08:00
|
|
|
-DLIB_SUFFIX=
|
|
|
|
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
|
|
|
-DPYTHON_BINDINGS=OFF
|
|
|
|
-DSTATICLIBS=${STATICLIBS}
|
2019-06-22 13:45:40 +08:00
|
|
|
)
|
|
|
|
|
2021-11-06 03:55:49 +08:00
|
|
|
vcpkg_cmake_install()
|
2024-09-13 10:28:25 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-06-22 13:45:40 +08:00
|
|
|
|
2024-09-13 10:28:25 +08:00
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/cmake/libftdi1/LibFTDI1Config.cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake/libftdi1/LibFTDI1Config-debug.cmake")
|
|
|
|
endif()
|
2021-11-06 03:55:49 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libftdi1)
|
2024-09-13 10:28:25 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" "/lib/cmake/${PORT}/" "/share/${PORT}/")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "/debug/lib/cmake/${PORT}/" "/share/${PORT}/")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "{_IMPORT_PREFIX}" "{VCPKG_IMPORT_PREFIX}")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "{VCPKG_IMPORT_PREFIX}/debug/include/" "{VCPKG_IMPORT_PREFIX}/include/")
|
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" release_config)
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" "
|
|
|
|
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES \"^[Dd][Ee][Bb][Uu][Gg]\$\")
|
|
|
|
include(\"\${CMAKE_CURRENT_LIST_DIR}/LibFTDI1Config-debug.cmake\")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
${release_config}"
|
|
|
|
)
|
|
|
|
endif()
|
2021-12-02 11:21:52 +08:00
|
|
|
|
2021-11-06 03:55:49 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2024-09-13 10:28:25 +08:00
|
|
|
if(NOT "cpp" IN_LIST FEATURES)
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libftdipp1.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libftdipp1.pc")
|
2020-07-30 02:22:12 +08:00
|
|
|
endif()
|
2019-06-22 13:45:40 +08:00
|
|
|
|
2024-09-13 10:28:25 +08:00
|
|
|
set(file_list "${SOURCE_PATH}/COPYING.LIB")
|
|
|
|
if("cpp" IN_LIST FEATURES)
|
|
|
|
set(file_list "${SOURCE_PATH}/LICENSE" "${SOURCE_PATH}/COPYING.LIB" "${SOURCE_PATH}/COPYING.GPL")
|
|
|
|
endif()
|
2020-07-30 02:22:12 +08:00
|
|
|
|
2024-09-13 10:28:25 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST ${file_list})
|