with open('crates/fluids/coolprop-sys/build.rs', 'r') as f: text = f.read() # CoolProp has a CMake option that we need to turn ON to compile the C-wrapper # DCOOLPROP_CATCH_TEST=OFF -> replace with adding DCOOLPROP_C_LIBRARY=ON text = text.replace('.define("COOLPROP_CATCH_TEST", "OFF")', '.define("COOLPROP_CATCH_TEST", "OFF")\n .define("COOLPROP_C_LIBRARY", "ON")') with open('crates/fluids/coolprop-sys/build.rs', 'w') as f: f.write(text)