[sword-svn] r2678 - trunk/cmake/toolchains

greg.hellings at crosswire.org greg.hellings at crosswire.org
Mon Feb 13 17:57:03 MST 2012


Author: greg.hellings
Date: 2012-02-13 17:57:03 -0700 (Mon, 13 Feb 2012)
New Revision: 2678

Added:
   trunk/cmake/toolchains/Toolchain-mingw64-x64.cmake
   trunk/cmake/toolchains/Toolchain-mingw64-x86.cmake
Log:
Adding standard cross-compile CMake toolchain files to allow building
for Windows from Linux.

Added: trunk/cmake/toolchains/Toolchain-mingw64-x64.cmake
===================================================================
--- trunk/cmake/toolchains/Toolchain-mingw64-x64.cmake	                        (rev 0)
+++ trunk/cmake/toolchains/Toolchain-mingw64-x64.cmake	2012-02-14 00:57:03 UTC (rev 2678)
@@ -0,0 +1,37 @@
+SET(MINGW32_ROOT "/usr/x86_64-w64-mingw32/sys-root/mingw")
+
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# specify the cross compiler
+SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
+
+# where is the target environment
+SET(CMAKE_FIND_ROOT_PATH "${MINGW32_ROOT}" /usr/local/x86_64-w64-mingw32)
+
+# search for programs in the build host directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# FindQt4.cmake queries qmake to get information,
+# which doesn't work when crosscompiling
+SET(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include)
+SET(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib)
+
+# set the resource compiler (RHBZ #652435)
+SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)
+
+# override boost library suffix which defaults to -mgw
+SET(Boost_COMPILER -gcc45)
+
+# Since ICU is all strange and smart and stuff, let's do this
+SET(ICU_CONFIG_BIN_PATH "${MINGW32_ROOT}/bin/")
+SET(ICU_CONFIG_OPTS "--noverify")
+
+INCLUDE_DIRECTORIES("${MINGW32_ROOT}/include/glib-2.0")
+INCLUDE_DIRECTORIES("${MINGW32_ROOT}/lib/glib-2.0/include")
+
+SET(CROSS_COMPILE_MINGW32 TRUE)
+

Added: trunk/cmake/toolchains/Toolchain-mingw64-x86.cmake
===================================================================
--- trunk/cmake/toolchains/Toolchain-mingw64-x86.cmake	                        (rev 0)
+++ trunk/cmake/toolchains/Toolchain-mingw64-x86.cmake	2012-02-14 00:57:03 UTC (rev 2678)
@@ -0,0 +1,36 @@
+SET(MINGW32_ROOT "/usr/i686-w64-mingw32/sys-root/mingw")
+
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# specify the cross compiler
+SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
+
+# where is the target environment
+SET(CMAKE_FIND_ROOT_PATH "${MINGW32_ROOT}" /usr/local/i686-w64-mingw32)
+
+# search for programs in the build host directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# FindQt4.cmake queries qmake to get information,
+# which doesn't work when crosscompiling
+SET(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include)
+SET(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib)
+
+# set the resource compiler (RHBZ #652435)
+SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
+
+# override boost library suffix which defaults to -mgw
+SET(Boost_COMPILER -gcc45)
+
+# Since ICU is all strange and smart and stuff, let's do this
+SET(ICU_CONFIG_BIN_PATH "${MINGW32_ROOT}/bin/")
+SET(ICU_CONFIG_OPTS "--noverify")
+
+INCLUDE_DIRECTORIES("${MINGW32_ROOT}/include/glib-2.0")
+INCLUDE_DIRECTORIES("${MINGW32_ROOT}/lib/glib-2.0/include")
+
+SET(CROSS_COMPILE_MINGW32 TRUE)




More information about the sword-cvs mailing list