annotate Resources/MinGW64Toolchain.cmake @ 838:aabc3b430890 templating

integration mainline -> templating
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Jun 2014 13:24:44 +0200
parents ec2c2411d4db
children
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
571
ec2c2411d4db versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 514
diff changeset
4 set(CMAKE_SYSTEM_NAME Windows)
514
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++
571
ec2c2411d4db versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 514
diff changeset
20 set(CMAKE_C_COMPILER ${MINGW64_PREFIX}-w64-mingw32-gcc)
ec2c2411d4db versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 514
diff changeset
21 set(CMAKE_CXX_COMPILER ${MINGW64_PREFIX}-w64-mingw32-g++)
ec2c2411d4db versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 514
diff changeset
22 set(CMAKE_RC_COMPILER ${MINGW64_PREFIX}-w64-mingw32-windres)
514
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
571
ec2c2411d4db versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 514
diff changeset
25 set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
514
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)