2019-06-27 05:51:58 +08:00
|
|
|
set(FREEXL_VERSION_STR "1.0.4")
|
2019-10-05 22:51:07 +08:00
|
|
|
|
2017-10-03 01:54:00 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2019-06-27 05:51:58 +08:00
|
|
|
URLS "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-${FREEXL_VERSION_STR}.tar.gz"
|
|
|
|
FILENAME "freexl-${FREEXL_VERSION_STR}.tar.gz"
|
2017-10-03 01:54:00 +08:00
|
|
|
SHA512 d72561f7b82e0281cb211fbf249e5e45411a7cdd009cfb58da3696f0a0341ea7df210883bfde794be28738486aeb4ffc67ec2c98fd2acde5280e246e204ce788
|
|
|
|
)
|
2019-10-08 01:35:13 +08:00
|
|
|
|
2019-10-05 22:51:07 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
PATCHES
|
|
|
|
fix-makefiles.patch
|
|
|
|
fix-sources.patch
|
2019-06-27 05:51:58 +08:00
|
|
|
)
|
2019-10-05 22:51:07 +08:00
|
|
|
|
|
|
|
set(LIBS_ALL_DBG
|
|
|
|
"\"${CURRENT_INSTALLED_DIR}/debug/lib/libiconv.lib\" \
|
|
|
|
\"${CURRENT_INSTALLED_DIR}/debug/lib/libcharset.lib\""
|
2019-06-27 05:51:58 +08:00
|
|
|
)
|
2019-10-05 22:51:07 +08:00
|
|
|
set(LIBS_ALL_REL
|
|
|
|
"\"${CURRENT_INSTALLED_DIR}/lib/libiconv.lib\" \
|
|
|
|
\"${CURRENT_INSTALLED_DIR}/lib/libcharset.lib\""
|
2019-06-27 05:51:58 +08:00
|
|
|
)
|
2019-10-05 22:51:07 +08:00
|
|
|
|
|
|
|
vcpkg_install_nmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}/debug"
|
|
|
|
INST_DIR="${CURRENT_PACKAGES_DIR}/debug"
|
|
|
|
"LINK_FLAGS=/debug"
|
|
|
|
"LIBS_ALL=${LIBS_ALL_DBG}"
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
|
|
|
|
INST_DIR="${CURRENT_PACKAGES_DIR}"
|
|
|
|
"LINK_FLAGS="
|
2020-05-22 01:46:07 +08:00
|
|
|
"LIBS_ALL=${LIBS_ALL_REL}"
|
2019-10-05 22:51:07 +08:00
|
|
|
)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
|
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib)
|
|
|
|
else()
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/freexl.lib)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib)
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib ${CURRENT_PACKAGES_DIR}/lib/freexl.lib)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib)
|
|
|
|
endif()
|
2019-06-27 05:51:58 +08:00
|
|
|
endif()
|
2017-10-03 01:54:00 +08:00
|
|
|
|
2019-06-27 05:51:58 +08:00
|
|
|
elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
|
|
|
|
|
2019-10-05 22:51:07 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
)
|
2020-05-22 01:46:07 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
|
2019-10-05 22:51:07 +08:00
|
|
|
vcpkg_configure_make(
|
2020-08-14 04:32:55 +08:00
|
|
|
AUTOCONFIG
|
2019-10-05 22:51:07 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
|
|
|
|
"LINK_FLAGS=/debug"
|
|
|
|
"CL_FLAGS=${CL_FLAGS_DBG}"
|
|
|
|
"LIBS_ALL=${LIBS_ALL_DBG}"
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
|
|
|
|
"LINK_FLAGS="
|
|
|
|
"CL_FLAGS=${CL_FLAGS_REL}"
|
|
|
|
"LIBS_ALL=${LIBS_ALL_REL}"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
2020-05-22 01:46:07 +08:00
|
|
|
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
|
2019-10-05 22:51:07 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
|
2019-06-27 05:51:58 +08:00
|
|
|
|
|
|
|
else()# Other build system
|
|
|
|
message(FATAL_ERROR "Unsupported build system.")
|
|
|
|
endif()
|
2017-10-03 01:54:00 +08:00
|
|
|
|
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET} done")
|