[liblemon] build failure
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
### Operating system
Ubuntu 22.04.5
### Compiler
gcc (Ubuntu 11.4.0-1ubuntu1~22.04)
### Steps to reproduce the behavior
```Shell
Installation of liblemon:arm64-linux@2019-06-13#9 as a dependency using cmake version 4.0.2 from kitware APT.
```
### Failure logs
```
/root/vcpkg/scripts/toolchains/linux.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-linux" "-DVCPKG_SET_CHARS
no longer supports it. The policy was introduced in CMake version 3.0.0,
and use of NEW behavior is now required.
Please either update your CMakeLists.txt files to conform to the new
behavior or use an older version of CMake that still supports the old
behavior. Run cmake --help-policy CMP0026 for more information.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:15 (INCLUDE):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /usr/bin/python3.10 (found version "3.10.12")
-- Found Wget: /usr/bin/wget
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen missing components: dot
-- Found Ghostscript: /usr/bin/gs
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.
```
### Additional context
Temporary local fix, based on [lemon-ed2c21cbd6ef.zip](https://lemon.cs.elte.hu/hg/lemon/archive/ed2c21cbd6ef.zip):
```diff
diff --git a/ports/liblemon/fix-cmake-policies.patch b/ports/liblemon/fix-cmake-policies.patch
new file mode 100644
index 0000000000..a88e8d7621
--- /dev/null
+++ b/ports/liblemon/fix-cmake-policies.patch
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4406bc2..0ef969b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,12 +1,13 @@
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
++cmake_minimum_required(VERSION 3.16...3.28)
++cmake_policy(SET CMP0148 NEW)
+
+-IF(POLICY CMP0048)
+- CMAKE_POLICY(SET CMP0048 OLD)
++IF(POLICY CMP0048)
++ cmake_policy(SET CMP0048 NEW)
+ ENDIF(POLICY CMP0048)
+
+ IF(POLICY CMP0026)
+ #This is for copying the dll's needed by glpk (in lp_test and mip_test)
+- CMAKE_POLICY(SET CMP0026 OLD)
++ cmake_policy(SET CMP0026 NEW)
+ ENDIF(POLICY CMP0026)
+
+ SET(PROJECT_NAME "LEMON")
diff --git a/ports/liblemon/fix-cmake-python.patch b/ports/liblemon/fix-cmake-python.patch
new file mode 100644
index 0000000000..1887571ced
--- /dev/null
+++ b/ports/liblemon/fix-cmake-python.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0ef969b..5f63793 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,7 +13,7 @@ ENDIF(POLICY CMP0026)
+ SET(PROJECT_NAME "LEMON")
+ PROJECT(${PROJECT_NAME})
+
+-INCLUDE(FindPythonInterp)
++find_package(Python COMPONENTS Interpreter REQUIRED)
+ INCLUDE(FindWget)
+
+ IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
diff --git a/ports/liblemon/fix-cmp0026.patch b/ports/liblemon/fix-cmp0026.patch
new file mode 100644
index 0000000000..e119f5ee0f
--- /dev/null
+++ b/ports/liblemon/fix-cmp0026.patch
@@ -0,0 +1,58 @@
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 96fc5dd..84c15ff 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -83,21 +83,17 @@ IF(LEMON_HAVE_LP)
+ ADD_DEPENDENCIES(check lp_test)
+
+ IF(WIN32 AND LEMON_HAVE_GLPK)
+- GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
+- GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+ ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
+- )
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $
++ )
+ ENDIF()
+
+ IF(WIN32 AND LEMON_HAVE_CPLEX)
+- GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
+- GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+ ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
+- COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
+- )
++ COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} $
++ )
+ ENDIF()
+ ENDIF()
+
+@@ -125,20 +121,16 @@ IF(LEMON_HAVE_MIP)
+ ADD_DEPENDENCIES(check mip_test)
+
+ IF(WIN32 AND LEMON_HAVE_GLPK)
+- GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
+- GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+ ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
+- COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
+- )
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $
++ COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $
++ )
+ ENDIF()
+
+ IF(WIN32 AND LEMON_HAVE_CPLEX)
+- GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
+- GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+ ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
+- COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
++ COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} $
+ )
+ ENDIF()
+ ENDIF()
diff --git a/ports/liblemon/portfile.cmake b/ports/liblemon/portfile.cmake
index 6db26e4429..9048123b8c 100644
--- a/ports/liblemon/portfile.cmake
+++ b/ports/liblemon/portfile.cmake
@@ -14,6 +14,9 @@ vcpkg_extract_source_archive(
SOURCE_BASE "${VERSION}"
PATCHES
fix-cmake.patch
+ fix-cmp0026.patch
+ fix-cmake-policies.patch
+ fix-cmake-python.patch
)
vcpkg_cmake_configure(
```
Contributor guide
Assessment
This issue has not been assessed yet.