LaurentGomila/SFML — Issue #109: cmake - Cross-compile for Windows fails
Author: RetroX
Created: 2011-10-10 16:21:42+00:00
State: open

Under Macros.cmake:

string(REGEX REPLACE "(.*)/bin/.*\\.exe" "\\1" STANDARD_LIBS_PATH "${CMAKE_CXX_COMPILER}")

This won't work when cross-compiling because the executable doesn't end with .exe. So, when searching for libs, the path ends up being /usr/bin/i486-mingw32-g++/lib. To fix it, it must be changed to:

string(REGEX REPLACE "(.*)/bin/.*" "\\1" STANDARD_LIBS_PATH "${CMAKE_CXX_COMPILER}")

Which will work just as well.