At first look it serms that pcre.h cannot be found during Release build. If this is the case you should have an error message about a missing include file. For a better answer you should give more details, especially the CMakelist.txt and the full error log.