annotate Resources/MinGW64Toolchain.cmake @ 561:ded40a9e8cc8 laaw

patches for lsb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 23 Sep 2013 17:52:38 +0200
parents a3d9acf37161
children ec2c2411d4db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
514
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # http://sourceforge.net/apps/trac/mingw-w64/wiki/GeneralUsageInstructions
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # the name of the target operating system
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 SET(CMAKE_SYSTEM_NAME Windows)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 # Detect the prefix of the mingw-w64 compiler
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 execute_process(
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 COMMAND uname -p
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 OUTPUT_VARIABLE MINGW64_ARCHITECTURE
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 OUTPUT_STRIP_TRAILING_WHITESPACE
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 )
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 if (${MINGW64_ARCHITECTURE} STREQUAL "x86_64")
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 set(MINGW64_PREFIX "x86_64")
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 else()
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 set(MINGW64_PREFIX "i686")
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 endif()
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # which compilers to use for C and C++
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 SET(CMAKE_C_COMPILER ${MINGW64_PREFIX}-w64-mingw32-gcc)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 SET(CMAKE_CXX_COMPILER ${MINGW64_PREFIX}-w64-mingw32-g++)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 SET(CMAKE_RC_COMPILER ${MINGW64_PREFIX}-w64-mingw32-windres)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 # here is the target environment located
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 # adjust the default behaviour of the FIND_XXX() commands:
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 # search headers and libraries in the target environment, search
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 # programs in the host environment
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
a3d9acf37161 build script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 SET(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} <SOURCE> <OBJECT>")