Toolchain-mingw64.cmake 4.87 KB
Newer Older
1
2
3
#download Qt5 mingw64 environment from :
#http://www.rpmfind.net//linux/RPM/fedora/21/x86_64/m/mingw64-qt5-qtbase-5.3.2-1.fc21.noarch.html

4
5
6
# cd buildwin64
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../win64/Toolchain-mingw64.cmake ..

7
SET (NOGUI 0)
8
SET (NOQWT 1)
9
10
# scp index.html tryphon@bioinformatics.org:~/public_html/populations
#
11
#SET (MINGW32 1)
12
13
14
15
16
17
18
#SET (WIN32 1)

# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

19
SET (WINDAUBE_ENV_PATH /home/langella/opt)
20
21
22
23
24
25
# it worked on 27 nov 2013 :
# download and install from http://download.qt-project.org/archive/qt/4.8/4.8.2/ the mingw32 version

#SET(QMAKE_PREFIX    /usr/bin/qmake-qt4 -spec win32-crossCompil-g++ CONFIG=release)
#SET(QT_PREFIX    /usr/local/src/mingw32_f15/qt-4.7.1/i686-pc-mingw32/sys-root/mingw)
#SET(QT_PREFIX    /usr/local/src/mingw_qt/usr/i686-pc-mingw32/sys-root/mingw)
26
SET(QT_PREFIX    ${WINDAUBE_ENV_PATH}/Qt64-4.8.6)
27
28
29
30

#SET(QWT_PREFIX  /usr/local/src/mingw32_f15/qwt-5.2.1/i686-pc-mingw32/sys-root/mingw)
#SET(QWT_PREFIX  /usr/local/src/mingw_qwt/usr/i686-pc-mingw32/sys-root/mingw)
SET(QWT_PREFIX  ${WINDAUBE_ENV_PATH}/qwt-5.2.2)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
SET(QT_PREFIX    ${WINDAUBE_ENV_PATH}/qt-4.8.7)
SET(QT5_PREFIX    ${WINDAUBE_ENV_PATH}/qt-5.6.0)

SET (ZLIB_INCLUDE_DIR "/home/langella/opt/zlib-1.2.8/include")
SET (QUAZIP_INCLUDE_DIR "/home/langella/opt/quazip-0.7.2")

SET (ODSSTREAM_DIR "/home/langella/developpement/git/libodsstream")
SET (ODSSTREAM_INCLUDE_DIR "${ODSSTREAM_DIR}/src")
SET (ODSSTREAM_QT4_LIBRARY "${ODSSTREAM_DIR}/buildw64/src/libodsstream-qt4.dll.a")

  SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
  SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
  SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/buildw64/src/libpappsomspp-qt4.dll.a")

45
46
47
48
49
50
51
52
53
54
55
56
57
58

#SET(QT_MOC_EXECUTABLE      /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/moc)
#SET(QMAKE_UIC      /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/uic)
#SET(QMAKE_RCC      /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/rcc)

# specify the cross compiler
#SET(CMAKE_C_COMPILER   /usr/local/src/mingw32_f15/gcc-4.5.3/bin/i686-pc-mingw32-gcc)
#SET(CMAKE_CXX_COMPILER /usr/local/src/mingw32_f15/gcc-c++-4.5.3/bin/i686-pc-mingw32-g++)
#SET(CMAKE_RC_COMPILER /usr/bin/i586-mingw32msvc-windres)
#cc++
SET(CMAKE_C_COMPILER   /usr/bin/x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)

59
60
INCLUDE_DIRECTORIES( ${QUAZIP_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})

61
62
# where is the target environment
#http://qt.nokia.com/downloads/windows-cpp
63
SET(CMAKE_FIND_ROOT_PATH  /usr/i586-mingw32msvc ${QT_PREFIX} ${QWT_PREFIX} )
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#SET(CMAKE_FIND_ROOT_PATH  /usr/local/src/mingw32_f15/glibc-2.13 /usr/local/src/mingw32_f15/gcc-4.5.3/i686-pc-mingw32/sys-root/mingw ${QT_PREFIX} ${QWT_PREFIX})

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


set (CMAKE_CXX_FLAGS "-fexceptions -mthreads -fmessage-length=0 -fident")

set(ADD_MINGW_EXE_LINKER_FLAGS
  "-static-libgcc -static-libstdc++"
  )
#--enable-auto-import
#set(CMAKE_EXE_LINKER_FLAGS
#"${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-auto-import"
#)
# remove console
#set(CMAKE_EXE_LINKER_FLAGS
#"${CMAKE_EXE_LINKER_FLAGS} -Wl,--subsystem,windows"
#)

#set(
#CMAKE_SHARED_LIBRARY_CXX_FLAGS
#"${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -Wl,--enable-auto-import "
#)
#set(
#CMAKE_SHARED_LIBRARY_CXX_FLAGS
#"${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -shared -Wl,--subsystem,windows -DDLL"
#)

set(Qwt5_INCLUDE_DIR ${QWT_PREFIX}/src)
set(Qwt5_Qt4_LIBRARY ${QWT_PREFIX}/lib)
SET( Qwt5_Qt4_FOUND TRUE )
SET( Qwt5_Qt4_TENTATIVE_LIBRARY ${Qwt5_Qt4_LIBRARY}/libqwt5.a )

set(QT_HEADERS_DIR ${QT_PREFIX}/include)
set(QT_LIBRARY_DIR ${QT_PREFIX}/lib)

104
105
set(QT_QTCORE_LIBRARY ${QT_PREFIX}/lib/libQtCore4.dll.a)
set(QT_QTCORE_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtCore4.dll.a)
106
107
set(QT_QTCORE_INCLUDE_DIR ${QT_PREFIX}/include/QtCore)

108
109
set(QT_QTXML_LIBRARY ${QT_PREFIX}/lib/libQtXml4.dll.a)
set(QT_QTXML_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtXml4.dll.a)
110
111
set(QT_QTXML_INCLUDE_DIR ${QT_PREFIX}/include/QtXml)

112
113
set(QT_QTGUI_LIBRARY ${QT_PREFIX}/lib/libQtGui4.dll.a)
set(QT_QTGUI_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtGui4.dll.a)
114
115
set(QT_QTGUI_INCLUDE_DIR ${QT_PREFIX}/include/QtGui)

116
117
set(QT_QTXMLPATTERNS_LIBRARY ${QT_PREFIX}/lib/libQtXmlPatterns4.dll.a)
set(QT_QTXMLPATTERNS_RELEASE ${QT_PREFIX}/lib/libQtXmlPatterns4.dll.a)
118
119
120
121
122
123
124
125
126
127
set(QT_QTXMLPATTERNS_INCLUDE_DIR ${QT_PREFIX}/include/QtXmlPatterns)


#set(QT_BINARY_DIR   ${QT_PREFIX}/bin)
#set(QT_LIBRARY_DIR  ${QT_PREFIX}/lib)
#set(QT_QTCORE_LIBRARY   ${QT_PREFIX}/lib/libQtCore4.a)
#set(QT_QTCORE_INCLUDE_DIR ${QT_PREFIX}/include/QtCore)
#set(QT_MOC_EXECUTABLE  ${QT_PREFIX}/moc)
#set(QT_QMAKE_EXECUTABLE  ${QT_PREFIX}/qmake)
#set(QT_UIC_EXECUTABLE  ${QT_PREFIX}/uic)