Can we say that if $P=NP$ there is no CPA secure public key encryption?
There is no direct inference from $P = NP$ or $P \neq NP$ to security or insecurity of any particular encryption algorithm. As far as practical consequences are concerned, the "$P = NP$" problem is severely overhyped.

If $P = NP$ then any problem for which a solution can be verified in polynomial time can also be solved in polynomial time. "Polynomial time" does not automatically mean fast, for two reasons:


Complexity classes like $P$ and $NP$ are about asymptotic behaviour: they give us values for sufficiently large instances of the problem. Nothing tells us that a specific instance is large enough for the asymptotic behaviour to be an accurate description of the computational cost of solving that instance. For instance, asymptotically speaking, GNFS is a faster integer factorization algorithm than Quadratic Sieve; but, in practice, QS is faster than GNFS for integers of less than 300 bits. Proving $P = NP$ would imply that there exists a polynomial algorithm to solve integer factorization (or discrete logarithm), but it would not follow that this algorithm is indeed efficient for a 1024-bit integer.
"Polynomial" means "with cost proportional to $n^x$ for a problem of size $n$ and some constant integer $x$". Nothing guarantees that $x$ is small. A $O(n^{20})$ algorithm is completely polynomial, and completely out of reach of our technology for a size $n \geq 32$ bits...