summaryrefslogtreecommitdiffstats
path: root/toolchain-cygwin32.cmake
blob: f4d58d684429381e6fa8b88d83beefe0bc001375 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SET(CMAKE_SYSTEM_NAME CYGWIN)
SET(CMAKE_SYSTEM_PROCESSOR x86)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0)

# specify the cross compiler
IF(NOT DEFINED ENV{CC})
    SET(CMAKE_C_COMPILER /usr/bin/i686-pc-cygwin-gcc)
ENDIF()
IF(NOT DEFINED ENV{CXX})
    SET(CMAKE_CXX_COMPILER /usr/bin/i686-pc-cygwin-g++)
ENDIF()
IF(NOT DEFINED ENV{FC})
    SET(CMAKE_Fortran_COMPILER /usr/bin/i686-pc-cygwin-gfortran)
ENDIF()

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/i686-pc-cygwin/sys-root/usr)

# 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)

# Make sure Qt can be detected by CMake
SET(QT_BINARY_DIR /usr/i686-pc-cygwin/bin /usr/bin)

# set the resource compiler (RHBZ #652435)
IF(NOT $ENV{RC})
    SET(CMAKE_RC_COMPILER /usr/bin/i686-pc-cygwin-windres)
ENDIF()

# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_AR:FILEPATH /usr/bin/i686-pc-cygwin-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-pc-cygwin-ranlib)

# Workaround failure to detect boost (see #2037724)
SET(Boost_ARCHITECTURE "-x32")