summaryrefslogtreecommitdiff
path: root/CMakeLists.txt.linux
blob: 28e75469e0f5775041ebd31b0ab7f14a9a33d849 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
find_package(OpenSSL REQUIRED)
find_package(ALSA)
find_package(OSS)

set(CMAKE_VERBOSE_MAKEFILE ON)

if (FQTERM_USE_STATIC_QT)
  ADD_DEFINITIONS(-DFQTERM_USE_STATIC_QT)
endif(FQTERM_USE_STATIC_QT)

if (ALSA_FOUND)
  ADD_DEFINITIONS(-DAUDIO_ALSA)
  SET(AUDIO_INCLUDE_DIR "${ALSA_INCLUDE_DIR}")
  SET(AUDIO_LIBRARY "${ALSA_LIBRARY}")
else (ALSA_FOUND)
  if (OSS_FOUND)
	ADD_DEFINITIONS(-DAUDIO_OSS)
	SET(AUDIO_INCLUDE_DIR "${OSS_INCLUDE_DIR}")
	SET(AUDIO_LIBRARY)
  endif (OSS_FOUND)
endif(ALSA_FOUND)

ADD_DEFINITIONS(-Wall)
ADD_DEFINITIONS(-D_OS_LINUX_)
ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")

add_subdirectory(src)

ADD_EXECUTABLE(fqterm.bin
  src/fqterm/main.cpp
)

include_directories(
  ${QT_INCLUDE_DIR}
  ${QT_QTCORE_INCLUDE_DIR}
  ${QT_QTGUI_INCLUDE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/src/common
  ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol
  ${CMAKE_CURRENT_SOURCE_DIR}/src/terminal
  ${CMAKE_CURRENT_SOURCE_DIR}/src/utilities
  ${CMAKE_CURRENT_SOURCE_DIR}/src/ui
  ${CMAKE_CURRENT_SOURCE_DIR}/src/unite
  ${AUDIO_INCLUDE_DIR}
)

link_directories(
  ${QT_PLUGINS_DIR}/codecs
  ${QT_PLUGINS_DIR}/imageformats
)

if (FQTERM_USE_STATIC_QT)
  set(FQ_QT_STATIC_PLUGINS
  ${QT_PLUGINS_DIR}/imageformats/libqgif.a    
  ${QT_PLUGINS_DIR}/imageformats/libqjpeg.a    
  ${QT_PLUGINS_DIR}/imageformats/libqmng.a    
  ${QT_PLUGINS_DIR}/codecs/libqcncodecs.a   
  ${QT_PLUGINS_DIR}/codecs/libqjpcodecs.a   
  ${QT_PLUGINS_DIR}/codecs/libqkrcodecs.a   
  ${QT_PLUGINS_DIR}/codecs/libqtwcodecs.a
  jpeg
  )
endif(FQTERM_USE_STATIC_QT)

target_link_libraries(fqterm.bin
  fqterm_main
  fqterm_terminal 
  fqterm_protocol 
  fqterm_utilities 
  fqterm_ui
  fqterm_common
  fqterm_unite 
  ${QT_QTNETWORK_LIBRARIES}
  ${QT_QTXML_LIBRARIES}
  ${QT_QTSCRIPT_LIBRARIES}  
  ${FQ_QT_STATIC_PLUGINS}
  ${QT_LIBRARIES}
  ${OPENSSL_LIBRARIES}
  ${AUDIO_LIBRARY}
  ${PYTHON_LIB}
  crypto
  X11
)

add_dependencies(fqterm.bin
  fqterm_main
  fqterm_common
  fqterm_terminal
  fqterm_protocol
  fqterm_ui
  fqterm_utilities
  fqterm_qm_target
)

add_custom_target(love
COMMAND FQTERM_RESOURCE=${CMAKE_SOURCE_DIR}/res ${CMAKE_BINARY_DIR}/fqterm.bin
DEPENDS ${CMAKE_BINARY_DIR}/fqterm.bin
)

INSTALL(
  FILES ${CMAKE_BINARY_DIR}/fqterm.bin
  DESTINATION bin/
  PERMISSIONS
      OWNER_EXECUTE OWNER_WRITE OWNER_READ
      GROUP_EXECUTE GROUP_READ
      WORLD_EXECUTE WORLD_READ
)

INSTALL(
  FILES ${CMAKE_SOURCE_DIR}/res/fqterm.sh
  DESTINATION bin/
  PERMISSIONS
      OWNER_EXECUTE OWNER_WRITE OWNER_READ
      GROUP_EXECUTE GROUP_READ
      WORLD_EXECUTE WORLD_READ
  RENAME fqterm
)

INSTALL(
  DIRECTORY ${CMAKE_SOURCE_DIR}/res/
  DESTINATION share/FQTerm/
  DIRECTORY_PERMISSIONS
              OWNER_EXECUTE OWNER_WRITE OWNER_READ
              GROUP_EXECUTE GROUP_READ
              WORLD_EXECUTE WORLD_READ
  FILE_PERMISSIONS
              OWNER_WRITE OWNER_READ
              GROUP_READ
              WORLD_READ
  PATTERN "*.svn*" EXCLUDE
  PATTERN "fqterm.desktop" EXCLUDE
)

INSTALL(
  FILES ${fqterm_qm_files}
  DESTINATION share/FQTerm/dict/
  PERMISSIONS
      OWNER_WRITE OWNER_READ
      GROUP_READ
      WORLD_READ
)

INSTALL(
  FILES res/fqterm.desktop
  DESTINATION share/applications
)

SET(CPACK_PACKAGE_CONTACT FireLakeWalker@gmail.com)
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
SET(CPACK_SYSTEM_NAME Linux-i386)
SET(CPACK_PACKAGE_VERSION ${FQTERM_VERSION})
SET(CPACK_DEBIAN_PACKAGE_VERSION ${FQTERM_VERSION}+i386)
SET(CPACK_DEBIAN_PACKAGE_SECTION Network)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This package is generated by FQTerm team, to get a formal version, please visit http://packages.debian.org/sid/main/fqterm.")

SET(CPACK_GENERATOR DEB)
INCLUDE(CPack)
# vim:ft=cmake: