summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 1bc0c70257f80fddec20c3301ce5fbbbd58d586f (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
#################################################
#
#  (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 2.6 )


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

project( tdevelop )
set( VERSION "3.5.4")


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

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


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

set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )


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

include( TDESetupPaths )
tde_setup_paths( )


##### 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
    ${QTDIR}/doc/html
    $ENV{QTDIR}/doc/html )
  if( NOT QT_DOCDIR )
    set( QT_DOCDIR "QT_DOCDIR is not set" )
  endif( )
endif( )

if( NOT DEFINED KDELIBS_DOXYDIR )
  set( KDELIBS_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 "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )


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

install( FILES
    tdevelop.desktop kdevassistant.desktop tdevelop_ruby.desktop
    tdevelop_c_cpp.desktop tdevelop_kde_cpp.desktop
    tdevelop_scripting.desktop
  DESTINATION ${XDG_APPS_INSTALL_DIR} )

install( FILES
    tde-development-tdevelop.directory
  DESTINATION ${XDG_DIRECTORY_INSTALL_DIR} )

install( FILES
    x-tdevelop.desktop
  DESTINATION ${MIME_INSTALL_DIR}/application )

install( PROGRAMS
    kdevprj2tdevelop
  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 )