Skip to content

Commit 04f48d2

Browse files
committed
cmake: copy libscip to package
1 parent 0068438 commit 04f48d2

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

cmake/dotnet.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ set(need_cbc_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Cbc}>>")
397397
set(need_unix_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
398398
set(need_windows_highs_lib "$<AND:${is_windows},$<BOOL:${BUILD_HIGHS}>>")
399399

400+
set(need_unix_scip_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_SCIP}>>")
401+
set(need_windows_scip_lib "$<AND:${is_windows},$<BOOL:${BUILD_SCIP}>>")
402+
400403
set(is_ortools_shared "$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>")
401404
set(need_unix_ortools_lib "$<AND:${is_not_windows},${is_ortools_shared}>")
402405
set(need_windows_ortools_lib "$<AND:${is_windows},${is_ortools_shared}>")

cmake/java.cmake

+11-2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ set(need_unix_cbc_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Cbc}>>")
300300
set(need_unix_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
301301
set(need_windows_highs_lib "$<AND:${is_windows},$<BOOL:${BUILD_HIGHS}>>")
302302

303+
set(need_unix_scip_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_SCIP}>>")
304+
set(need_windows_scip_lib "$<AND:${is_windows},$<BOOL:${BUILD_SCIP}>>")
305+
303306
set(is_ortools_shared "$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>")
304307
set(need_unix_ortools_lib "$<AND:${is_not_windows},${is_ortools_shared}>")
305308
set(need_windows_ortools_lib "$<AND:${is_windows},${is_ortools_shared}>")
@@ -445,8 +448,14 @@ add_custom_command(
445448

446449
COMMAND ${CMAKE_COMMAND} -E
447450
$<IF:$<BOOL:${BUILD_HIGHS}>,copy,true>
448-
$<${need_unix_highs_lib}:$<TARGET_SONAME_FILE:highs>>
449-
$<${need_windows_highs_lib}:$<TARGET_FILE:highs>>
451+
$<${need_unix_highs_lib}:$<TARGET_SONAME_FILE:highs::highs>>
452+
$<${need_windows_highs_lib}:$<TARGET_FILE:highs::highs>>
453+
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
454+
455+
COMMAND ${CMAKE_COMMAND} -E
456+
$<IF:$<BOOL:${BUILD_SCIP}>,copy,true>
457+
$<${need_unix_scip_lib}:$<TARGET_SONAME_FILE:SCIP::libscip>>
458+
$<${need_windows_scip_lib}:$<TARGET_FILE:SCIP::libscip>>
450459
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
451460

452461
COMMAND ${CMAKE_COMMAND} -E

cmake/python.cmake

+11-2
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ set(need_unix_cbc_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Cbc}>>")
460460
set(need_unix_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
461461
set(need_windows_highs_lib "$<AND:${is_windows},$<BOOL:${BUILD_HIGHS}>>")
462462

463+
set(need_unix_scip_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_SCIP}>>")
464+
set(need_windows_scip_lib "$<AND:${is_windows},$<BOOL:${BUILD_SCIP}>>")
465+
463466
set(is_ortools_shared "$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>")
464467
set(need_unix_ortools_lib "$<AND:${is_not_windows},${is_ortools_shared}>")
465468
set(need_windows_ortools_lib "$<AND:${is_windows},${is_ortools_shared}>")
@@ -605,8 +608,14 @@ add_custom_command(
605608

606609
COMMAND ${CMAKE_COMMAND} -E
607610
$<IF:$<BOOL:${BUILD_HIGHS}>,copy,true>
608-
$<${need_unix_highs_lib}:$<TARGET_SONAME_FILE:highs>>
609-
$<${need_windows_highs_lib}:$<TARGET_FILE:highs>>
611+
$<${need_unix_highs_lib}:$<TARGET_SONAME_FILE:highs::highs>>
612+
$<${need_windows_highs_lib}:$<TARGET_FILE:highs::highs>>
613+
${PYTHON_PROJECT}/.libs
614+
615+
COMMAND ${CMAKE_COMMAND} -E
616+
$<IF:$<BOOL:${BUILD_SCIP}>,copy,true>
617+
$<${need_unix_scip_lib}:$<TARGET_SONAME_FILE:SCIP::libscip>>
618+
$<${need_windows_scip_lib}:$<TARGET_FILE:SCIP::libscip>>
610619
${PYTHON_PROJECT}/.libs
611620

612621
COMMAND ${CMAKE_COMMAND} -E

ortools/dotnet/Google.OrTools.runtime.csproj.in

+5-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@
131131
$<@need_cgl_lib@:;$<TARGET_SONAME_FILE:Coin::Cgl>>
132132
$<@need_cbc_lib@:;$<TARGET_SONAME_FILE:Coin::Cbc>;$<TARGET_SONAME_FILE:Coin::OsiCbc>;$<TARGET_SONAME_FILE:Coin::CbcSolver>>
133133

134-
$<@need_unix_highs_lib@:;$<TARGET_SONAME_FILE:highs>>
135-
$<@need_windows_highs_lib@:;$<TARGET_FILE:highs>>
134+
$<@need_unix_highs_lib@:;$<TARGET_SONAME_FILE:highs::highs>>
135+
$<@need_windows_highs_lib@:;$<TARGET_FILE:highs::highs>>
136+
137+
$<@need_unix_scip_lib@:;$<TARGET_SONAME_FILE:SCIP::libscip>>
138+
$<@need_windows_scip_lib@:;$<TARGET_FILE:SCIP::libscip>>
136139

137140
$<@need_unix_ortools_lib@:;$<TARGET_SONAME_FILE:ortools>>
138141
$<@need_windows_ortools_lib@:;$<TARGET_FILE:ortools>>

ortools/java/com/google/ortools/Loader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static synchronized void loadNativeLibraries() {
143143
Path tempPath = unpackNativeResources(resourceURI);
144144
// libraries order does matter !
145145
List<String> dlls = Arrays.asList("zlib1", "abseil_dll", "re2", "utf8_validity",
146-
"libprotobuf", "highs", "ortools", "jniortools");
146+
"libprotobuf", "highs", "scip", "ortools", "jniortools");
147147
for (String dll : dlls) {
148148
try {
149149
// System.out.println("System.load(" + dll + ")");

ortools/python/__init__.py.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def _load_ortools_libs():
5555
except:
5656
pass
5757
else:
58-
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "re2.dll", "libprotobuf.dll", "highs.dll", "ortools.dll"]:
58+
for dll in ["zlib1.dll",
59+
"abseil_dll.dll", "utf8_validity.dll", "re2.dll", "libprotobuf.dll",
60+
"highs.dll", "scip.dll",
61+
"ortools.dll"]:
5962
dll_path = os.path.join(basedir, ".libs", dll)
6063
if os.path.exists(dll_path):
6164
print(f"load {dll_path}...")

0 commit comments

Comments
 (0)