vcpkg/ports/glpk/portfile.cmake
Fabio A. Correa 2ac8af6d70
[glpk] Add new port (#28364)
* Create portfile.cmake

* Add manifest and patches for glpk-5.0

* Shrink portfile.cmake

Removed some comments

* Update ci.baseline.txt to list glpk:x86-windows

* Addressing some reviewer comments and suggestions

* Addressing comments from microsoft/vcpkg#28364

* Trying out x86-windows again

* Updating the version database

* x-add-version glpk

* Addressing reviews

* Update version database: x-add-version glpk

* More compact code thanks to PR reviews

* format-manifest ports/glpk/vcpkg.json

* Update version database: x-add-version glpk

* No default features

* Update version database: x-add-version glpk
2022-12-29 10:28:12 -08:00

61 lines
1.8 KiB
CMake

vcpkg_minimum_required(VERSION 2022-10-12)
set(DISTFILE_SHA512_HASH 4e92195fa058c707146f2690f3a38b46c33add948c852f67659ca005a6aa980bbf97be96528b0f8391690facb880ac2126cd60198c6c175e7f3f06cca7e29f9d)
vcpkg_download_distfile(
DISTFILE
FILENAME "glpk.tar.gz"
URLS "https://ftpmirror.gnu.org/gnu/glpk/glpk-${VERSION}.tar.gz" "https://ftp.gnu.org/gnu/glpk/glpk-${VERSION}.tar.gz"
SHA512 ${DISTFILE_SHA512_HASH}
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${DISTFILE}"
PATCHES
configure.ac.patch
)
vcpkg_list(SET CONFIGURE_OPTIONS)
if("dl" IN_LIST FEATURES)
vcpkg_list(APPEND CONFIGURE_OPTIONS --enable-dl=dlfcn "LIBS=-ldl \$LIBS")
else()
vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-dl)
endif()
if("gmp" IN_LIST FEATURES)
vcpkg_list(APPEND CONFIGURE_OPTIONS --with-gmp)
else()
vcpkg_list(APPEND CONFIGURE_OPTIONS --without-gmp)
endif()
if("mysql" IN_LIST FEATURES)
vcpkg_list(APPEND CONFIGURE_OPTIONS
--enable-mysql
"CPPFLAGS=-I${CURRENT_INSTALLED_DIR}/include/mysql \$CPPFLAGS"
)
else()
vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-mysql)
endif()
if("odbc" IN_LIST FEATURES)
vcpkg_list(APPEND CONFIGURE_OPTIONS --enable-odbc)
else()
vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-odbc)
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
NO_ADDITIONAL_PATHS
DETERMINE_BUILD_TRIPLET
OPTIONS
${CONFIGURE_OPTIONS}
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
vcpkg_copy_tools(TOOL_NAMES glpsol AUTO_CLEAN)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)