summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 0936e21998c02ec31f8af6262945b85d0e4ca856 (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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

cmake_minimum_required( VERSION 3.5 )


##### general package setup #####################

project( tdevelop )


##### include essential cmake modules ###########

include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckIncludeFile )
include( CheckIncludeFileCXX )
include( CheckLibraryExists )
include( FindPkgConfig )


##### include our cmake modules #################

include( TDEMacros )


##### set version number ########################

tde_set_project_version( )


##### setup install paths #######################

include( TDESetupPaths )
tde_setup_paths( )


##### add apidox targets ############

if( "${CMAKE_VERSION}" VERSION_LESS "3.1" )
  set( CMAKE_ENV "env" )
else()
  set( CMAKE_ENV "${CMAKE_COMMAND};-E;env" )
endif()

add_custom_target( apidox
  COMMAND ${CMAKE_ENV}
    "TQTDOCDIR=/usr/share/tqt3/doc/html"
    "DOXDATA=${HTML_INSTALL_DIR}/en/common"
    ${CMAKE_SOURCE_DIR}/admin/doxygen.sh
    --no-modulename
    ${CMAKE_SOURCE_DIR}
  COMMAND
    find ${CMAKE_BINARY_DIR}/apidocs -name '*.html' |
    xargs -r sed -i 's|${CMAKE_BINARY_DIR}/apidocs|${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs|g'
  COMMAND
    find ${CMAKE_BINARY_DIR}/apidocs -name '*.tag' |
    xargs -r sed -i 's|${CMAKE_SOURCE_DIR}/|${PROJECT_NAME}/|g'
  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

add_custom_target( install-apidox
  COMMAND ${CMAKE_COMMAND} -E echo Apidox installed in ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
)

install( CODE "
  if( EXISTS ${CMAKE_BINARY_DIR}/apidocs )
    file(
      INSTALL ${CMAKE_BINARY_DIR}/apidocs/
      DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
      PATTERN doxygen_sqlite3.db EXCLUDE
      PATTERN installdox-slow EXCLUDE
    )
  endif()"
)


##### build tools ###############################

option( WITH_BUILDTOOL_ALL "Enable all build tools" OFF )
option( WITH_BUILDTOOL_ADA "Enable ada build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_ANT "Enable ant build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_AUTOTOOLS "Enable autotools build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_CUSTOMMAKEFILES "Enable custommakefiles build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_PASCAL "Enable pascal build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_QMAKE "Enable qmake build tool" ${WITH_BUILDTOOL_ALL} )
option( WITH_BUILDTOOL_SCRIPT "Enable script build tool" ${WITH_BUILDTOOL_ALL} )


##### languages #################################

option( WITH_LANGUAGE_ALL "Enable all languages" OFF )
option( WITH_LANGUAGE_ADA "Enable ada language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_BASH "Enable bash language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_CPP "Enable cpp language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_FORTRAN "Enable fortran language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_JAVA "Enable java language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_CSHARP "Enable csharp language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_PASCAL "Enable pascal language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_PERL "Enable perl language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_PHP "Enable php language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_PYTHON "Enable python language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_RUBY "Enable ruby language" ${WITH_LANGUAGE_ALL} )
option( WITH_LANGUAGE_SQL "Enable sql language" ${WITH_LANGUAGE_ALL} )


##### version control systems ###################

option( WITH_VCS_ALL "Enable all version control systems"  OFF )
option( WITH_VCS_CLEARCASE "Enable clearcase support" ${WITH_VCS_ALL} )
option( WITH_VCS_CVSSERVICE "Enable cvsservice support" ${WITH_VCS_ALL} )
option( WITH_VCS_PERFORCE "Enable perforce support" ${WITH_VCS_ALL} )
option( WITH_VCS_SUBVERSION "Enable subversion support" ${WITH_VCS_ALL} )


##### components ################################

option( BUILD_ALL "Build all components" OFF )
option( BUILD_KDEVDESIGNER "Build kdevdesigner" ${BUILD_ALL} )
option( BUILD_VISUALBOYADVANCE "Build embedded/visualboyadvance" ${BUILD_ALL} )
option( BUILD_DOC "Build doc" ${BUILD_ALL} )


##### optional stuff ############################

option( WITH_DEPRECATION "Enable deprecation warnings" OFF )


##### configure checks ##########################

include( ConfigureChecks.cmake )


##### various definitions #######################

if( NOT DEFINED QT_DOCDIR )
  find_path( QT_DOCDIR index.html
    ${TQTDIR}/doc/html
    $ENV{TQTDIR}/doc/html )
  if( NOT QT_DOCDIR )
    set( QT_DOCDIR "QT_DOCDIR is not set" )
  endif( )
endif( )

if( NOT DEFINED TDELIBS_DOXYDIR )
  set( TDELIBS_DOXYDIR "${TDE_HTML_DIR}/en/tdelibs-apidocs" )
endif( )


if( NOT DEFINED FULL_MAKE_COMMAND )
  find_program( FULL_MAKE_COMMAND
    NAMES gmake )
  if( NOT FULL_MAKE_COMMAND )
    find_program( FULL_MAKE_COMMAND
      NAMES make )
    if( NOT FULL_MAKE_COMMAND )
      tde_message_fatal( "Either make or gmake was NOT found." )
    endif( NOT FULL_MAKE_COMMAND )
  endif( NOT FULL_MAKE_COMMAND )
endif( NOT DEFINED FULL_MAKE_COMMAND )


if( NOT DEFINED MAKE_COMMAND )
  GET_FILENAME_COMPONENT( MAKE_COMMAND "${FULL_MAKE_COMMAND}" NAME )
endif( NOT DEFINED MAKE_COMMAND )


###### global compiler settings #################

add_definitions(
  -DHAVE_CONFIG_H
  ${TQT_CFLAGS_OTHER}
)

if( NOT WITH_DEPRECATION )
  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated" )
endif( )

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )


##### install data ##############################

tde_create_translated_desktop(
  SOURCE
    tdevelop.desktop kdevassistant.desktop tdevelop_ruby.desktop
    tdevelop_c_cpp.desktop tdevelop_kde_cpp.desktop
    tdevelop_scripting.desktop
  PO_DIR tdevelop-desktops
)

tde_create_translated_desktop(
  SOURCE tde-development-tdevelop.directory
  DESTINATION ${XDG_DIRECTORY_INSTALL_DIR}
  PO_DIR tdevelop-desktops
)

tde_create_translated_desktop(
  SOURCE x-tdevelop.desktop
  DESTINATION ${MIME_INSTALL_DIR}/application
  PO_DIR tdevelop-desktops
)

install( PROGRAMS
    kdevprj2kdevelop
  DESTINATION ${BIN_INSTALL_DIR} )


##### source directories ########################

add_subdirectory( lib )
add_subdirectory( src )
add_subdirectory( parts )
add_subdirectory( buildtools )
add_subdirectory( editors )
add_subdirectory( languages )
add_subdirectory( mimetypes )
add_subdirectory( pics )
add_subdirectory( vcs )
add_subdirectory( embedded )
tde_conditional_add_subdirectory( BUILD_KDEVDESIGNER kdevdesigner )
tde_conditional_add_subdirectory( BUILD_DOC doc )


##### write configure files #####################

configure_file( config.h.cmake config.h @ONLY )