diff --git a/patch.py b/patch.py index 1abf04f..3528aa4 100644 --- a/patch.py +++ b/patch.py @@ -20,9 +20,9 @@ full_patch.append( Addition( - Path.cwd()/'cmake'/'cpp.cmake', - ' $<$:libscip>\n', - ' $<$:sirius_solver>\n')) + Path.cwd()/'cmake'/'cpp.cmake', + ' ${SCIP_DEPS}\n', + ' $<$:sirius_solver>\n')) full_patch.append(Addition( Path.cwd()/'cmake'/'cpp.cmake', ''' @@ -60,7 +60,7 @@ Path.cwd()/'cmake'/'ortoolsConfig.cmake.in', ''' if(@USE_SCIP@) - if(NOT scip_FOUND AND NOT TARGET libscip) + if(NOT TARGET libscip) find_dependency(SCIP REQUIRED) endif() endif() @@ -81,13 +81,13 @@ Path.cwd()/'examples'/'cpp'/'linear_programming.cc', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' -)) + )) full_patch.append(Addition( Path.cwd()/'examples'/'dotnet'/'cslinearprogramming.cs', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' -)) + )) full_patch.append(Addition( Path.cwd()/'examples'/'java'/'LinearProgramming.java', diff --git a/patch_utils.py b/patch_utils.py index f3ee539..c337aff 100644 --- a/patch_utils.py +++ b/patch_utils.py @@ -4,6 +4,9 @@ def replace_in_file(filepath, search, replace): with open(filepath, 'r', encoding="utf8") as file: data = file.read() + if search not in data: + print(f"File {filepath}: string {search} not found, replace skipped") + return if replace not in data: data = data.replace(search, replace) else: