Sorry if this has already been covered but my google-fu hasn't gotten me anywhere.

I'm trying to cross compile a project I've helped develop a cmake configuration for since the autotools one doesn't work for all platforms currently.

I've had luck cross compiling all the dependencies but when I try to build the project I end up with undefined references and I noticed there's not a single -I/usr/i686/... type option anywhere in the build results:

/usr/bin/i686-w64-mingw32-g++   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4  -Wall -mthreads -O3 -DNDEBUG    -mwindows -Wl,--whole-archive CMakeFiles/freedv.dir/objects.a -Wl,--no-whole-archive  -o freedv.exe -Wl,--out-implib,libfreedv.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -lportaudio-2 -lsamplerate -lsndfile -lsox -L/usr/i686-w64-mingw32/sys-root/mingw/lib -Wl,--subsystem,windows -mwindows -lwx_mswu_core-2.9-i686-w64-mingw32 -lwx_baseu-2.9-i686-w64-mingw32 -lwx_mswu_aui-2.9-i686-w64-mingw32 -lwx_mswu_html-2.9-i686-w64-mingw32 -lwx_baseu_net-2.9-i686-w64-mingw32 -lwx_mswu_adv-2.9-i686-w64-mingw32 /usr/i686-w64-mingw32/sys-root/mingw/bin/libcodec2.dll -Wl,-Bstatic -lctb -Wl,-Bdynamic -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 
CMakeFiles/freedv.dir/objects.a(fdmdv2_main.cpp.obj): In function `ZN9MainFrame15SetupSerialPortEv':
/home/build/mingw32-proj/fdmdv2-0.96.svn1244/src/fdmdv2_main.cpp:3046: undefined reference to `ctb::SerialPort::SerialPort()'
/home/build/mingw32-proj/fdmdv2-0.96.svn1244/src/fdmdv2_main.cpp:3047: undefined reference to `ctb::SerialPort_x::Open(char const*, int, char const*, ctb::SerialPort_x::FlowControl)'
collect2: error: ld returned 1 exit status

libctb is installed and found by cmake...

Is this not required when cross compiling?

Thanks,
Richard