summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 17:19:23 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 17:19:23 +0200
commite7e895438497f4efcb4d8bee240b2fe4e5938184 (patch)
tree96af8bb4258a784babc027c801bd379639fd2074 /cmake
parente9660c47c69327a131c4e4b15bea4bdc7937fd61 (diff)
downloadcolobot-e7e895438497f4efcb4d8bee240b2fe4e5938184.tar.gz
colobot-e7e895438497f4efcb4d8bee240b2fe4e5938184.tar.bz2
colobot-e7e895438497f4efcb4d8bee240b2fe4e5938184.zip
MXE support and CMake files refactoring
- added support for cross-compiling with MXE (http://mxe.cc/) - refactored CMake files, adding some options and moving definitions to more suitable places
Diffstat (limited to 'cmake')
-rw-r--r--cmake/mxe.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/mxe.cmake b/cmake/mxe.cmake
new file mode 100644
index 0000000..4507a80
--- /dev/null
+++ b/cmake/mxe.cmake
@@ -0,0 +1,29 @@
+# When cross-compiling with MXE, we need to straighten some things
+
+# Checking is a bit primitive, but this should detect MXE toolchain file
+if((${CMAKE_CROSSCOMPILING}) AND (DEFINED MSYS))
+ message(STATUS "Detected MXE build")
+ set(MXE 1)
+ # Because some tests will not compile
+ set(TESTS OFF)
+ # All must be static, CBOT and GLEW too
+ set(CBOT_STATIC ON)
+ set(GLEW_STATIC ON)
+ # Because find package scripts are lame
+ set(SDLTTF_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/SDL)
+ set(SDLIMAGE_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/SDL)
+ set(MXE_LIBS
+ # For some reason, these have to be absolute paths
+ ${CMAKE_FIND_ROOT_PATH}/lib/libintl.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libiconv.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libglew32s.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libfreetype.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libltdl.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libopengl32.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libjpeg.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libwinmm.a
+ ${CMAKE_FIND_ROOT_PATH}/lib/libdxguid.a
+ )
+else()
+ set(MXE 0)
+endif() \ No newline at end of file