Trouble compiling under Ubuntu 12.04

I successfully followed the directions on https://kicad.org/contribute/build-linux/ using Ubuntu 12.04 under Parallels on a Mac, but it won’t work on a native system doing exactly the same thing. The first error is:
[ 38%] Building CXX object polygon/CMakeFiles/polygon.dir/clipper.cpp.o
/home/drmike/Engineering_Research/Kicad/kicad.bzr/polygon/clipper.cpp: In member function ‘void ClipperLib::Clipper::FixupFirstLefts3(ClipperLib::OutRec*, ClipperLib::OutRec*)’:
/home/drmike/Engineering_Research/Kicad/kicad.bzr/polygon/clipper.cpp:3680:13: warning: unused variable ‘firstLeft’ [-Wunused-variable]
In file included from /home/drmike/Engineering_Research/Kicad/kicad.bzr/polygon/math_for_graphics.cpp:8:0:
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:391:33: error: ‘wxFileName’ was not declared in this scope
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:391:49: error: ‘aTargetFullFileName’ was not declared in this scope
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:392:35: error: expected primary-expression before ‘const’
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:393:43: error: expected primary-expression before ‘*’ token
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:393:51: error: ‘aReporter’ was not declared in this scope
/home/drmike/Engineering_Research/Kicad/kicad.bzr/include/common.h:393:68: error: expression list treated as compound expression in initializer [-fpermissive]

I compiled with -j 6 so there are a lot more errors, but they all seem related to wx* functions. I did install wx-3.0 and patched FindwxWidgets.cmake with
set (_filename “/usr/local/include/wx-3.0/wx/version.h”)
# find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)

That patch worked the first time, but it doesn’t seem to work here (or something else is messed up). Any ideas on how to get past this set of errors?

My previous version of kicad still works, but I can’t read the files I created on the other computer because it is the latest version.
Thanks!

I solved the problem, so I will post it here in case anyone else has something similar weird happen to them.

I turned on the dbg_msg( ) macro (and _v as well) and added a debug message after the line
find_program(wxWidgets_CONFIG_EXECUTABLE wx-config
ONLY_CMAKE_FIND_ROOT_PATH
)
dbg_msg(“wxWidgets_CONFIG_EXECUTABLE=${wxWidgets_CONFIG_EXECUTABLE}”)

What I got was wxWidgets_CONFIG_EXECUTABLE pointing to /usr/bin/wx-config, but when I ran “which wx-config” I got the correct version as /usr/local/bin/wx-config which is the 3.0 version wxWidgets. I tried several of the commands like HINTS and PATH for the find_program(), but it failed. What ended up working was to use

/usr/bin$ sudo mv wx-config wxconfig2.8
/usr/bin$ sudo ln /usr/local/bin/wx-config wx-config

after that the whole thing compiled.
I have no clue why cmake is looking in the wrong place, but at this point I have it compiling.