We have derived an expression for the global stress in inhomogeneous complex copolymer liquids. We apply the principle of virtual work to the free energy as defined in the dynamic mean-field density functional method. This method automatically provides the full stress tensor (deviatoric and isotropic parts) and hence an equation of state for inhomogeneous compressible copolymer melts. The excluded volume interactions and cohesive interactions between chains have been explicitly taken into account. Therefore the expressions for the stress and thermodynamic pressure have a wide range of validity. The connectivity of the chains is automatically accounted for and the free energy adapts very well to changes in the molecule properties. In the lim...