CMake is building the project files that have those include directories in them. If it locates perl successfully then the directories will be correct.
When you uninstall perl, make sure you manually go to where you installed it and delete the entire perl directory before installing a different version. The add/remove programs uninstall doesn't always do a complete job.
Once you've gotten perl 5.12 installed and redone the steps to configure and generate in CMake, open up the CMakeCache.txt file in the Build directory in Notepad and search for PERL_LIBRARY. You should see something like this:
Code:
//Path to a program.
PERL_EXECUTABLE:FILEPATH=C:/EQEmu/Perl/bin/perl.exe
//Path to a file.
PERL_INCLUDE_PATH:PATH=C:/EQEmu/Perl/lib/CORE
//Path to a library.
PERL_LIBRARY:FILEPATH=C:/EQEmu/Perl/lib/CORE/perl512.lib
If those aren't pointing to where you just installed perl, or the version on the library is wrong then you still have an issue and need to get rid of the wrong directory it is pointing to then redo the CMake steps again until it is right.