File: cmake-tweak.patch

package info (click to toggle)
highs 1.12.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,592 kB
  • sloc: cpp: 133,006; ansic: 12,649; python: 4,167; f90: 1,113; cs: 974; lisp: 151; makefile: 60; perl: 46; sh: 38
file content (95 lines) | stat: -rw-r--r-- 2,943 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Description: CMake-related tweaks
 Remove RPATH
Author: Shengqi Chen <harry@debian.org>
Forwarded: not-needed
Last-Update: 2025-01-08
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/highs/CMakeLists.txt
+++ b/highs/CMakeLists.txt
@@ -55,12 +55,6 @@
     set(CONF_DEPENDENCIES "include(CMakeFindDependencyMacro)\nfind_dependency(ZLIB)")
   endif()
 
-  # set the install rpath to the installed destination
-  if(APPLE)
-      set_target_properties(libhighs PROPERTIES INSTALL_RPATH "@loader_path")
-  elseif (UNIX)
-      set_target_properties(libhighs PROPERTIES INSTALL_RPATH "$ORIGIN")
-  endif()
 
   # install the header files of highs
   foreach(file ${headers})
@@ -150,11 +144,6 @@
 
   set_target_properties(highs PROPERTIES POSITION_INDEPENDENT_CODE ON)
 
-  if(APPLE)
-      set_target_properties(highs PROPERTIES INSTALL_RPATH "@loader_path")
-  elseif (UNIX)
-      set_target_properties(highs PROPERTIES INSTALL_RPATH "$ORIGIN")
-  endif()
 
 
   target_sources(highs PRIVATE ${sources} ${headers} ${win_version_file})
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,10 +88,6 @@
 
 option(PYTHON_BUILD_SETUP "Build Python interface from setup.py" OFF)
 message(STATUS "Build Python: ${PYTHON_BUILD_SETUP}")
-if (PYTHON_BUILD_SETUP)
-  set(BUILD_CXX OFF)
-  set(BUILD_TESTING OFF)
-endif()
 
 include(CMakeDependentOption)
 
--- a/cmake/python-highs.cmake
+++ b/cmake/python-highs.cmake
@@ -40,10 +40,10 @@
 # add module
 # pybind11_add_module(highspy highspy/highs_bindings.cpp)
 
-target_link_libraries(_core PRIVATE pybind11::headers)
+target_link_libraries(_core PRIVATE pybind11::headers highs)
 
 # sources for python 
-target_sources(_core PUBLIC ${sources_python} ${headers_python})
+target_sources(_core PUBLIC ${headers_python})
 
 # include directories for python 
 target_include_directories(_core PUBLIC ${include_dirs_python})
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -32,13 +32,6 @@
 
     include(GNUInstallDirs)
 
-    if(APPLE)
-        set_target_properties(highs-bin PROPERTIES INSTALL_RPATH 
-        "@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
-    elseif (UNIX)
-        set_target_properties(highs-bin PROPERTIES INSTALL_RPATH 
-        "$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
-      
       # cmake_path is 3.20, leave for later.
       # cmake_path(RELATIVE_PATH CMAKE_INSTALL_FULL_LIBDIR
       #        BASE_DIRECTORY ${CMAKE_INSTALL_FULL_BINDIR}
@@ -52,16 +45,6 @@
       EXPORT highs-targets
       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-    if(BUILD_TESTING)
-      if (APPLE)
-        set(CMAKE_INSTALL_RPATH
-                "@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
-      elseif (UNIX)
-        set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN:$ORIGIN/../lib:$ORIGIN")
-      endif ()
-    endif()
-
-  endif()
 else()
   # create highs binary using library without pic
   add_executable(highs)