Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding OGDF and LEMON library port (#3779)
* Adding OGDF library port * Adding C++ Graph library - LEMON * [liblemon][ogdf] Rename lemon -> liblemon. Fix cmake targets.
- Loading branch information
1 parent
4924569
commit fae4bd4
Showing
6 changed files
with
158 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,3 @@ | ||
Source: liblemon | ||
Version: 1.3.1-1 | ||
Description: Library for Efficient Modeling and Optimization in Networks |
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,34 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 03e1cc7..fd9d737 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -280,6 +280,13 @@ ELSEIF(WIN32) | ||
) | ||
ENDIF() | ||
|
||
+install( | ||
+ EXPORT lemon-targets | ||
+ FILE lemon-config.cmake | ||
+ NAMESPACE lemon:: | ||
+ DESTINATION share/lemon | ||
+) | ||
+ | ||
CONFIGURE_FILE( | ||
${PROJECT_SOURCE_DIR}/cmake/version.cmake.in | ||
${PROJECT_BINARY_DIR}/cmake/version.cmake | ||
diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt | ||
index 4e6567e..76f9cae 100644 | ||
--- a/lemon/CMakeLists.txt | ||
+++ b/lemon/CMakeLists.txt | ||
@@ -71,6 +71,11 @@ INSTALL( | ||
COMPONENT library | ||
) | ||
|
||
+install(TARGETS lemon EXPORT lemon-targets | ||
+ LIBRARY DESTINATION lib | ||
+ ARCHIVE DESTINATION lib | ||
+) | ||
+ | ||
INSTALL( | ||
DIRECTORY . bits concepts | ||
DESTINATION include/lemon |
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,50 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 9a7c918..3d6cf35 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -268,7 +268,7 @@ CONFIGURE_FILE( | ||
${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake | ||
@ONLY | ||
) | ||
-IF(UNIX) | ||
+IF(UNIX OR TRUE) | ||
INSTALL( | ||
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake | ||
DESTINATION share/lemon/cmake | ||
@@ -282,9 +282,9 @@ ENDIF() | ||
|
||
install( | ||
EXPORT lemon-targets | ||
- FILE lemon-config.cmake | ||
- NAMESPACE lemon:: | ||
- DESTINATION share/lemon | ||
+ FILE lemon-targets.cmake | ||
+ NAMESPACE unofficial::lemon:: | ||
+ DESTINATION share/lemon/cmake | ||
) | ||
|
||
CONFIGURE_FILE( | ||
diff --git a/cmake/LEMONConfig.cmake.in b/cmake/LEMONConfig.cmake.in | ||
index b0d2d8b..ce54986 100644 | ||
--- a/cmake/LEMONConfig.cmake.in | ||
+++ b/cmake/LEMONConfig.cmake.in | ||
@@ -1,4 +1,4 @@ | ||
-SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory") | ||
+SET(LEMON_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../include" CACHE PATH "LEMON include directory") | ||
SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}") | ||
|
||
IF(UNIX) | ||
@@ -7,7 +7,12 @@ ELSEIF(WIN32) | ||
SET(LEMON_LIB_NAME "lemon.lib") | ||
ENDIF(UNIX) | ||
|
||
-SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library") | ||
+SET(LEMON_LIBRARY | ||
+ optimized "${CMAKE_CURRENT_LIST_DIR}/../../lib/${LEMON_LIB_NAME}" | ||
+ debug "${CMAKE_CURRENT_LIST_DIR}/../../debug/lib/${LEMON_LIB_NAME}" | ||
+ CACHE FILEPATH "LEMON library") | ||
SET(LEMON_LIBRARIES "${LEMON_LIBRARY}") | ||
|
||
MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR) | ||
+ | ||
+include(./lemon-targets.cmake) |
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,46 @@ | ||
include(vcpkg_common_functions) | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
message("Dynamic linkage not supported. Building static instead.") | ||
set(VCPKG_LIBRARY_LINKAGE static) | ||
endif() | ||
|
||
set(VERSION 1.3.1) | ||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lemon-${VERSION}) | ||
vcpkg_download_distfile(ARCHIVE | ||
URLS "http://lemon.cs.elte.hu/pub/sources/lemon-${VERSION}.zip" | ||
FILENAME "lemon-${VERSION}.zip" | ||
SHA512 86d15914b8c3cd206a20c37dbe3b8ca4b553060567a07603db7b6f8dd7dcf9cb043cca31660ff1b7fb77e359b59fac5ca0aab57fd415fda5ecca0f42eade6567 | ||
) | ||
vcpkg_extract_source_archive(${ARCHIVE}) | ||
|
||
vcpkg_apply_patches( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PATCHES | ||
${CMAKE_CURRENT_LIST_DIR}/cmake.patch | ||
${CMAKE_CURRENT_LIST_DIR}/fixup-targets.patch | ||
) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
-DLEMON_ENABLE_GLPK=OFF | ||
-DLEMON_ENABLE_ILOG=OFF | ||
-DLEMON_ENABLE_COIN=OFF | ||
-DLEMON_ENABLE_SOPLEX=OFF | ||
) | ||
|
||
vcpkg_install_cmake() | ||
|
||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/lemon/cmake TARGET_PATH share/lemon) | ||
|
||
file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe) | ||
file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/liblemon/) | ||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/liblemon) | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) | ||
|
||
# Handle copyright | ||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblemon RENAME copyright) |
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,3 @@ | ||
Source: ogdf | ||
Version: 2018-03-28-1 | ||
Description: Open Graph Drawing Framework |
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,22 @@ | ||
include(vcpkg_common_functions) | ||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/2018-03-28/OGDF-snapshot) | ||
vcpkg_download_distfile(ARCHIVE | ||
URLS "http://www.ogdf.net/lib/exe/fetch.php/tech:ogdf-snapshot-2018-03-28.zip" | ||
FILENAME "ogdf-2018-03-28.zip" | ||
SHA512 a6ddb33bc51dca4d59fcac65ff66459043b11ce5303e9d40e4fc1756adf84a0af7d0ac7debab670111e7a145dcdd9373c0e350d5b7e831b169811f246b6e19b6 | ||
) | ||
vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src/2018-03-28) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
) | ||
|
||
vcpkg_install_cmake() | ||
|
||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OGDF) | ||
|
||
# Handle copyright | ||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogdf RENAME copyright) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/minisat/doc ${CURRENT_PACKAGES_DIR}/include/ogdf/lib/minisat/doc) |