[liblemon] Fix cmake config (#33130)

* [liblemon] Fix cmake config

* update version database

* update patch

* update version database
This commit is contained in:
Weihang Ding 2023-08-15 08:28:50 +08:00 committed by GitHub
parent 0789630513
commit d695b9fda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 89 additions and 91 deletions

View File

@ -1,34 +0,0 @@
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

View File

@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a7c918..3d6cf35 100644 index 4406bc2..5717680 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -268,7 +268,7 @@ CONFIGURE_FILE( @@ -295,7 +295,7 @@ CONFIGURE_FILE(
${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
@ONLY @ONLY
) )
@ -11,21 +11,22 @@ index 9a7c918..3d6cf35 100644
INSTALL( INSTALL(
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
DESTINATION share/lemon/cmake DESTINATION share/lemon/cmake
@@ -282,9 +282,9 @@ ENDIF() @@ -307,6 +307,13 @@ ELSEIF(WIN32)
)
ENDIF()
install( +install(
EXPORT lemon-targets + EXPORT lemon-targets
- FILE lemon-config.cmake
- NAMESPACE lemon::
- DESTINATION share/lemon
+ FILE lemon-targets.cmake + FILE lemon-targets.cmake
+ NAMESPACE unofficial::lemon:: + NAMESPACE unofficial::lemon::
+ DESTINATION share/lemon/cmake + DESTINATION share/lemon/cmake
) +)
+
CONFIGURE_FILE( CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
${PROJECT_BINARY_DIR}/cmake/version.cmake
diff --git a/cmake/LEMONConfig.cmake.in b/cmake/LEMONConfig.cmake.in diff --git a/cmake/LEMONConfig.cmake.in b/cmake/LEMONConfig.cmake.in
index b0d2d8b..ce54986 100644 index b0d2d8b..6bb662a 100644
--- a/cmake/LEMONConfig.cmake.in --- a/cmake/LEMONConfig.cmake.in
+++ b/cmake/LEMONConfig.cmake.in +++ b/cmake/LEMONConfig.cmake.in
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
@ -47,4 +48,31 @@ index b0d2d8b..ce54986 100644
MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR) MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR)
+ +
+include(${CMAKE_CURRENT_LIST_DIR}/lemon-targets.cmake) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/lemon-targets.cmake)
diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt
index 4e6567e..ad6f5bf 100644
--- a/lemon/CMakeLists.txt
+++ b/lemon/CMakeLists.txt
@@ -56,6 +56,10 @@ ENDIF()
ADD_LIBRARY(lemon ${LEMON_SOURCES})
+INCLUDE(GNUInstallDirs)
+
+TARGET_INCLUDE_DIRECTORIES(lemon PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+
TARGET_LINK_LIBRARIES(lemon
${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES}
)
@@ -71,6 +75,11 @@ INSTALL(
COMPONENT library
)
+install(TARGETS lemon EXPORT lemon-targets
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
INSTALL(
DIRECTORY . bits concepts
DESTINATION include/lemon

View File

@ -13,8 +13,7 @@ vcpkg_extract_source_archive(
ARCHIVE "${ARCHIVE}" ARCHIVE "${ARCHIVE}"
SOURCE_BASE "${VERSION}" SOURCE_BASE "${VERSION}"
PATCHES PATCHES
cmake.patch fix-cmake.patch
fixup-targets.patch
) )
vcpkg_cmake_configure( vcpkg_cmake_configure(
@ -30,6 +29,8 @@ vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH share/lemon/cmake PACKAGE_NAME lemon) vcpkg_cmake_config_fixup(CONFIG_PATH share/lemon/cmake PACKAGE_NAME lemon)
vcpkg_fixup_pkgconfig()
file(GLOB EXE "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(GLOB EXE "${CURRENT_PACKAGES_DIR}/bin/*.exe")
file(COPY ${EXE} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/liblemon/") file(COPY ${EXE} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/liblemon/")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/liblemon") vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/liblemon")
@ -39,6 +40,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
# Handle copyright vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()

View File

@ -1,7 +1,7 @@
{ {
"name": "liblemon", "name": "liblemon",
"version-date": "2019-06-13", "version-date": "2019-06-13",
"port-version": 6, "port-version": 7,
"description": "Library for Efficient Modeling and Optimization in Networks", "description": "Library for Efficient Modeling and Optimization in Networks",
"homepage": "https://lemon.cs.elte.hu/trac/lemon", "homepage": "https://lemon.cs.elte.hu/trac/lemon",
"dependencies": [ "dependencies": [

View File

@ -4278,7 +4278,7 @@
}, },
"liblemon": { "liblemon": {
"baseline": "2019-06-13", "baseline": "2019-06-13",
"port-version": 6 "port-version": 7
}, },
"liblinear": { "liblinear": {
"baseline": "243", "baseline": "243",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "e7357874ce9b71f43cb1c298dbb1228ac9241a69",
"version-date": "2019-06-13",
"port-version": 7
},
{ {
"git-tree": "b51839207be0c83364a5fa07660067ea774cc814", "git-tree": "b51839207be0c83364a5fa07660067ea774cc814",
"version-date": "2019-06-13", "version-date": "2019-06-13",