forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [zimpl] New port * Fix msvc * MSVC needs pcre2 * Fix MSVC runtime * Fix msvc and mingw
- Loading branch information
Showing
6 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/zimpl/CMakeLists.txt b/zimpl/CMakeLists.txt | ||
index 7cf9d85..07fa187 100644 | ||
--- a/zimpl/CMakeLists.txt | ||
+++ b/zimpl/CMakeLists.txt | ||
@@ -151,6 +151,8 @@ include(CheckSymbolExists) | ||
find_library(libm m) | ||
if(NOT libm) | ||
set(libm "") | ||
+else() | ||
+ set(libm m) | ||
endif() | ||
|
||
set(libs ${libs} ${libm}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/zimpl/CMakeLists.txt b/zimpl/CMakeLists.txt | ||
index 7cf9d85..85d33a7 100644 | ||
--- a/zimpl/CMakeLists.txt | ||
+++ b/zimpl/CMakeLists.txt | ||
@@ -4,7 +4,7 @@ project(ZIMPL | ||
VERSION 3.5.3 | ||
LANGUAGES C) | ||
|
||
-if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
+if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT WIN32) | ||
# if changing these flags, also update GCCWARN/GXXWARN in make/make.project | ||
set(ADD_C_FLAGS -Wall -Wextra -Wno-unknown-pragmas -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-noreturn -Wmissing-declarations -fno-omit-frame-pointer) | ||
|
||
@@ -112,7 +112,6 @@ if(MSVC) | ||
) | ||
|
||
foreach(variable ${variables}) | ||
- string(REGEX REPLACE "/M[T,D][ d]" "" ${variable} "${${variable}}") | ||
# message("${variable} = ${${variable}}") | ||
endforeach() | ||
endif() | ||
@@ -128,9 +127,11 @@ if(ZLIB_FOUND) | ||
include_directories(${ZLIB_INCLUDE_DIRS}) | ||
else() | ||
add_definitions(-DWITHOUT_ZLIB) | ||
+endif() | ||
|
||
- # look for pcre if ZLIB could not be found | ||
- find_package(PCRE) | ||
+if(WIN32) | ||
+ find_package(PCRE NAMES pcre2 REQUIRED) | ||
+ set(PCRE_LIBRARIES "$<TARGET_NAME:PCRE2::POSIX>") | ||
if(PCRE_FOUND) | ||
add_definitions(-DWITH_PCRE) | ||
add_definitions(-DPCRE2_STATIC) | ||
diff --git a/zimpl/zimpl-config.cmake.in b/zimpl/zimpl-config.cmake.in | ||
index b653f0c..946f6f2 100644 | ||
--- a/zimpl/zimpl-config.cmake.in | ||
+++ b/zimpl/zimpl-config.cmake.in | ||
@@ -1,3 +1,8 @@ | ||
+if(WIN32) | ||
+ include(CMakeFindDependencyMacro) | ||
+ find_dependency(pcre2) | ||
+endif() | ||
+ | ||
if(NOT TARGET libzimpl) | ||
include("${CMAKE_CURRENT_LIST_DIR}/zimpl-targets.cmake") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
||
# The latest version of ZIMPL is included in the SCIP Optimization Suite. | ||
set(scipoptsuite_version 8.0.4) | ||
vcpkg_download_distfile(ARCHIVE | ||
URLS "https://scipopt.org/download/release/scipoptsuite-${scipoptsuite_version}.tgz" | ||
SHA512 46b56b3a4a5fcb4d6d53b5ffd9320bdf37fb55b9b8450a065312aa1e4f88863d3c563a495cf2622ef70a80132149c7b8f36cdb9a9e43906f4cfcafcb9dd6d606 | ||
FILENAME "scipoptsuite-${scipoptsuite_version}.tgz" | ||
) | ||
vcpkg_extract_source_archive( | ||
SOURCE_PATH | ||
ARCHIVE "${ARCHIVE}" | ||
PATCHES | ||
libm.diff | ||
msvc.diff | ||
) | ||
|
||
vcpkg_find_acquire_program(BISON) | ||
vcpkg_find_acquire_program(FLEX) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}/zimpl" | ||
OPTIONS | ||
-DBREW=false | ||
"-DBISON_EXECUTABLE=${BISON}" | ||
"-DFLEX_EXECUTABLE=${FLEX}" | ||
-DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=1 | ||
MAYBE_UNUSED_VARIABLES | ||
BREW | ||
) | ||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zimpl) | ||
vcpkg_copy_tools(TOOL_NAMES zimpl AUTO_CLEAN) | ||
|
||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zimpl/zimpl-config.cmake" "../../../include" "../../include") | ||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zimpl/mmlparse2.h" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/zimpl/" "") | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/zimpl/LICENSE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "zimpl", | ||
"version": "3.5.3", | ||
"description": "Zuse Institut Mathematical Programming Language", | ||
"homepage": "http://zimpl.zib.de/", | ||
"license": "LGPL-3.0-or-later", | ||
"supports": "!uwp", | ||
"dependencies": [ | ||
"gmp", | ||
{ | ||
"name": "pcre2", | ||
"platform": "windows" | ||
}, | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
}, | ||
"zlib" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "6598ebbe8c537c546a9cc0d71c8fd9e0a4dd6b94", | ||
"version": "3.5.3", | ||
"port-version": 0 | ||
} | ||
] | ||
} |