forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
551 lines (467 loc) · 21.5 KB
/
CMakeLists.txt
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
#################################################################################################################################################################
## #
## codelite IDE cmake file #
## Typical usage will be (build in release mode): #
## #
## > mkdir build #
## > cd build #
## > cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. #
## > make -jN #
## > sudo make install #
## #
## Optional command line arguments: #
## #
## -DCMAKE_BUILD_TYPE=Release|Debug|DebugFull // Build release, debug + optimisation or debug without optimisation (for others see the Cmake docs) #
## -DPREFIX="<some-prefix>" // Installation prefix, default is set to /usr #
## -DENABLE_CLANG=1|0 // Build codelite with clang code completion support?, default is 1 (with clang) #
## -DWITH_WXC=1|0 // Build wxCrafter (sources are not part of codelite distribution) default is 0 #
## -DCOPY_WX_LIBS=1|0 // Incorporate the wxWidgets libs into CodeLite so the binary doesn't depend on them. default is 0 #
## -DPREVENT_WX_ASSERTS=1|0 // Prevent those annoying wxASSERTS. In release builds the default is 1, in debug 0 #
## -DAUTOGEN_REVISION=1|0 // Should cmake generate makefiles that auto generates the autoversion.cpp file - default is 1 #
## -DWITH_PCH=1|0 // Enable Pre Compiled Header? #
## -DGTK_USE_NATIVEBOOK=1|0 // Under GTK, use the native notebook instead of wxAuiNoteook. Default is set to 0 #
## -DWITH_WXPATH=<fullpath> // Specify a particular wxWidgets build to use. The format must be /path/to/different_wx-config/directory/ #
## -DMAKE_DEB=1|0 // When set to 1, you can use make package to create .deb file for codelite #
## -DENABLE_SFTP=1|0 // When set to 1 codelite is built with SFTP support. Default is build _with_ SFTP support #
## -DENABLE_LLDB=1|0 // When set to 0 codelite won't try to build or link to the lldb debugger. Default is 1 on Unix platforms #
#################################################################################################################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
include(FindLibClang)
#############################################
## Defaults
#############################################
project( "CodeLite" )
## Generate compile_commands.json file for code completion
set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
set( CL_PREFIX "/usr" )
if (CMAKE_CURRENT_LIST_DIR) # since cmake 2.8.3
set( CL_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR})
else()
set( CL_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) # which seems to be the same, at least in this situation
endif()
set( USE_CLANG 1 )
set( IS_FREEBSD 0 )
set( BUILD_WXC 0 )
set( CL_COPY_WX_LIBS 0 )
set( WITH_SFTP 1 )
if ( UNIX )
execute_process(COMMAND pwd OUTPUT_VARIABLE BUILD_DIRECTORY OUTPUT_STRIP_TRAILING_WHITESPACE)
elseif(MINGW)
set ( BUILD_DIRECTORY ${CMAKE_BINARY_DIR} )
else()
set ( BUILD_DIRECTORY $ENV{CD} )
endif()
message( "-- BUILD_DIRECTORY is set to ${BUILD_DIRECTORY}")
set (OS_NAME "WIN")
if (UNIX)
execute_process(COMMAND uname -s OUTPUT_VARIABLE OS_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
message("-- OS name ${OS_NAME}")
if ( APPLE )
set(WX_COMPONENTS "std")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
else ( APPLE )
set(WX_COMPONENTS "std aui propgrid stc ribbon")
endif()
if (WITH_WXPATH)
set(ENV{PATH} ${WITH_WXPATH}:$ENV{PATH})
endif()
unset(WITH_WXPATH CACHE)
set( CL_WX_CONFIG wx-config )
if (UNIX OR MINGW)
execute_process(COMMAND which ${CL_WX_CONFIG} OUTPUT_VARIABLE WX_TOOL OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT WX_TOOL)
message(FATAL_ERROR
"\nNo functional wx_config script was found in your PATH.\nIs the wxWidgets development package installed?"
)
else()
execute_process(COMMAND sh ${WX_TOOL} --version OUTPUT_VARIABLE WX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(SUBSTRING "${WX_VERSION}" "0" "1" wxMAJOR_VERSION)
string(SUBSTRING "${WX_VERSION}" "2" "1" wxMINOR_VERSION)
string(SUBSTRING "${WX_VERSION}" "4" "1" wxRELEASE_NUMBER)
if ( wxMAJOR_VERSION LESS 3 )
message(FATAL_ERROR
"\nI'm afraid your wxWidgets version is too old.\nBuilding CodeLite requires at least wxWidgets-3.0.0"
)
endif()
if (MINGW)
execute_process(COMMAND sh ${WX_TOOL} --debug=no --rescomp OUTPUT_VARIABLE WX_RC_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "windres" "" WX_RC_FLAGS ${WX_RC_FLAGS})
set (CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} ${WX_RC_FLAGS}")
add_definitions(-D__WXMSW__)
endif (MINGW)
endif()
message("-- wx-config used is: ${WX_TOOL}")
message("-- wxWidgets version is: ${WX_VERSION}")
if (NOT APPLE AND NOT MINGW)
# Is the wx we are using built on gtk2 or 3?
execute_process(COMMAND ${WX_TOOL} --selected_config OUTPUT_VARIABLE WX_GTK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(SUBSTRING "${WX_GTK_VERSION}" "3" "1" GTK_VERSION)
message("-- gtk version is: ${GTK_VERSION}")
endif()
endif (UNIX OR MINGW)
########################################
## Override defaults with user input
########################################
set( CL_INSTALL_LIBDIR "lib" )
if ( PREFIX )
set ( CL_PREFIX ${PREFIX} )
else()
# If the caller hasn't set his own destination, install to a multi-arch lib dir if applicable
if (CMAKE_VERSION VERSION_GREATER 2.8.7 AND ( UNIX AND NOT APPLE ))
if (CMAKE_VERSION VERSION_GREATER 3.0.0)
# Prior to this, afaict the GNUInstallDirs module worked whatever the prefix
# Since, it looks at CMAKE_INSTALL_PREFIX which is /usr/local by default, and refuses to run the multiarch-setting code unless it's /usr/
# So, partly to comply with the default documented above, & partly for packaging, explicitly set it to /usr
set (CMAKE_INSTALL_PREFIX "/usr")
endif()
include (GNUInstallDirs) # defines CMAKE_INSTALL_LIBDIR to lib or lib64 or whatever. Available since cmake 2.8.8
set( CL_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} )
endif()
endif(PREFIX)
## Try to link-to or build lldb?
if (UNIX)
set(WITH_LLDB 1)
else()
set(WITH_LLDB 0)
endif()
if(ENABLE_LLDB MATCHES 0)
set(WITH_LLDB 0)
message("-- Disabling lldb support")
endif ()
unset(ENABLE_LLDB CACHE)
#######################################
## Locate libssh
#######################################
## Enable SFTP support?
if(ENABLE_SFTP MATCHES 0)
set( WITH_SFTP 0 )
endif (ENABLE_SFTP MATCHES 0)
unset(ENABLE_SFTP CACHE)
if ( WITH_SFTP )
if (UNIX AND NOT APPLE OR MINGW)
## Linux
if (MINGW)
find_library(LIBSSH_LIB NAMES ssh PATH_SUFFIXES lib)
find_path(LIBSSH_INCLUDE_DIR NAMES libssh.h PATH_SUFFIXES include/libssh)
else()
find_library(LIBSSH_LIB NAMES libssh.so HINTS /usr/local/lib /usr/lib ${CMAKE_INSTALL_LIBDIR})
find_path(LIBSSH_INCLUDE_DIR NAMES libssh.h HINTS /usr/local/include /usr/include PATH_SUFFIXES libssh)
endif()
string(FIND ${LIBSSH_INCLUDE_DIR} "NOTFOUND" LIBSSH_NOT_FOUND_POS)
if ( LIBSSH_NOT_FOUND_POS GREATER -1 )
if (UNIX AND NOT APPLE )
## Linux / FreeBSD
message("**** NOTICE: Install libssh-dev and try again")
else (UNIX AND NOT APPLE )
## OSX
message("**** NOTICE: Install libssh and try again (brew install libssh)")
endif (UNIX AND NOT APPLE )
message(FATAL_ERROR "-- Could not find libssh")
endif( LIBSSH_NOT_FOUND_POS GREATER -1 )
else ( UNIX AND NOT APPLE OR MINGW )
## OSX
set( LIBSSH_INCLUDE_DIR ${CL_SRC_ROOT}/sdk/libssh/include)
set( LIBSSH_LIB ${CL_SRC_ROOT}/sdk/libssh/lib/osx/libssh.a)
include_directories(${LIBSSH_INCLUDE_DIR})
endif ( UNIX AND NOT APPLE OR MINGW )
message("-- LIBSSH_LIB is set to ${LIBSSH_LIB}")
endif ( WITH_SFTP )
## enable clang support?
if(ENABLE_CLANG MATCHES 0)
set( USE_CLANG 0 )
endif (ENABLE_CLANG MATCHES 0)
unset(ENABLE_CLANG CACHE)
if (AUTOGEN_REVISION MATCHES 0)
set ( MAKE_AUTOGEN_REVISION_STRING 0)
else (AUTOGEN_REVISION MATCHES 1)
set ( MAKE_AUTOGEN_REVISION_STRING 1)
endif (AUTOGEN_REVISION MATCHES 0)
unset(AUTOGEN_REVISION CACHE)
## build wxCrafter?
if ( WITH_WXC )
set(BUILD_WXC 1)
if ( UNIX AND NOT APPLE )
set(WX_COMPONENTS "std aui propgrid stc richtext ribbon")
endif (UNIX AND NOT APPLE )
endif ( WITH_WXC )
unset(WITH_WXC CACHE)
## package the wx libs?
if (COPY_WX_LIBS MATCHES 1)
set( CL_COPY_WX_LIBS 1 )
endif()
unset(COPY_WX_LIBS CACHE)
## Will set PLUGINS_DIR to the proper location on Linux / OSX
include(OSXInstall)
## Under OSX, create the skeleton bundle directory
OSX_MAKE_BUNDLE_DIRECTORY()
add_definitions(-DYY_NEVER_INTERACTIVE=1)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
if (NOT MINGW)
add_definitions(-DINSTALL_DIR=\"${CL_PREFIX}/share/codelite\")
add_definitions(-DPLUGINS_DIR=\"${PLUGINS_DIR}\")
else()
add_definitions(-DNDEBUG)
add_definitions(-DUSE_POSIX_LAYOUT)
endif()
message("-- PLUGINS_DIR is set to ${PLUGINS_DIR}")
## Allow user to use wxAuiNotebook instead of the native notebook
if ( GTK_USE_NATIVEBOOK )
add_definitions( -DGTK_USE_NATIVEBOOK=1 )
message("-- Using wxNotebook")
else ( GTK_USE_NATIVEBOOK )
add_definitions( -DGTK_USE_NATIVEBOOK=0 )
message("-- Using wxAuiNotebook")
endif ( GTK_USE_NATIVEBOOK )
unset(GTK_USE_NATIVEBOOK CACHE)
#############################################
## Global optimizations
#############################################
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DebugFull)
message("-- Building in ${CMAKE_BUILD_TYPE} mode")
set( DEBUG_BUILD 1 )
set( CL_PCH_FILE "${CL_SRC_ROOT}/PCH/precompiled_header_dbg.h")
set( CL_PCH_TARGET "precompiled_header_dbg.h.gch")
## Set the libraries outout directory
set( CL_BIN_DIR bin)
set( CL_LIB_DIR lib)
add_custom_target(distclean COMMAND cd ${CL_SRC_ROOT}/PCH && $(MAKE) type=debug clean )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_BIN_DIR}" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CL_LIBPATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
message("-- Executables will be written into ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message("-- Shared Objects will be written into ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") ## No optimization, debug info
## In debug, only add NDEBUG if the user says so
if (PREVENT_WX_ASSERTS MATCHES 1)
message("-- Adding -DNDEBUG to definitions")
add_definitions(-DNDEBUG)
endif()
else ()
message("-- Building in Release mode")
set ( DEBUG_BUILD 0 )
set( CL_PCH_FILE "${CL_SRC_ROOT}/PCH/precompiled_header_release.h")
set( CL_PCH_TARGET "precompiled_header_release.h.gch")
add_custom_target(distclean COMMAND cd ${CL_SRC_ROOT}/PCH && $(MAKE) type=release clean )
## Set the libraries outout directory
set( CL_BIN_DIR bin)
set( CL_LIB_DIR lib)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_BIN_DIR}" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CL_LIBPATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
message("-- Executables will be written into ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message("-- Shared Objects will be written into ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") ## Optimize
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
endif(CMAKE_COMPILER_IS_GNUCXX)
## In release, add NDEBUG unless explicitly told not to
if (NOT PREVENT_WX_ASSERTS MATCHES 0)
message("-- Adding -DNDEBUG to definitions")
add_definitions(-DNDEBUG)
endif()
endif()
unset(CMAKE_BUILD_TYPE CACHE)
unset(PREVENT_WX_ASSERTS CACHE)
#############################################
## Determine if 32 or 64 bit
#############################################
set(ARCH 32)
set(ARCH_NAME i386)
if ( UNIX AND NOT APPLE )
execute_process(COMMAND /bin/sh -c "lsb_release -a|grep -i Codename | cut -d: -f2" OUTPUT_VARIABLE OS_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND /bin/sh -c "lsb_release -a|grep -i Distributor | cut -d: -f2" OUTPUT_VARIABLE OS_DISTRO OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND /bin/sh -c "uname -m" OUTPUT_VARIABLE OS_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
## replace any tab/space with nothing
string(REPLACE " " "" DISTRO_CODENAME "${OS_DISTRO}-${OS_CODENAME}-${OS_ARCH}")
string(REPLACE "\t" "" DISTRO_CODENAME "${DISTRO_CODENAME}")
string(TOLOWER ${DISTRO_CODENAME} DISTRO_CODENAME)
set(CPACK_SYSTEM_NAME "${DISTRO_CODENAME}")
message("-- CPACK_SYSTEM_NAME ${CPACK_SYSTEM_NAME}")
endif ( UNIX AND NOT APPLE )
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH 64)
set(ARCH_NAME x86_64)
endif()
message("-- ARCH ${ARCH}")
message("-- ARCH_NAME ${ARCH_NAME}")
##############################################
## CPack
##############################################
if ( MAKE_DEB )
message("-- Generating deb target")
if( ${ARCH} EQUAL 32 )
message("-- CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
else ()
message("-- CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
endif ()
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "codelite")
set(CPACK_PACKAGE_VERSION "7.1")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Eran Ifrah <eran.ifrah@gmail.com>") #required
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "codelite IDE for C/C++/PHP")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "build-essential, git, subversion, gdb")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk2.0-dev, libssh-dev, libedit-dev, libhunspell-dev, libclang-3.5-dev, clang-format-3.5, liblldb-3.5-dev")
INCLUDE(CPack)
endif( MAKE_DEB )
############################################
## Clang support
############################################
if (USE_CLANG)
if (APPLE)
set( CLANG_INCLUDE "${CL_SRC_ROOT}/sdk/clang/include" )
set( CLANG_LIBRARY "-L${CL_SRC_ROOT}/sdk/clang/lib -lclang" )
set( CLANG_BINARY "${CL_SRC_ROOT}/sdk/clang/lib/libclang.dylib")
elseif (MINGW)
find_package(LLVM)
if (LLVM_FOUND)
find_package(Clang)
if (CLANG_FOUND)
set( CLANG_INCLUDE "${CLANG_INCLUDE_DIRS}" )
set( CLANG_LIBRARY "${CLANG_LDFLAGS}")
set( CLANG_BINARY "")
endif ()
endif ()
elseif (UNIX)
FIND_LIBCLANG_OFFICIAL()
if ( LIBCLANG STREQUAL "LIBCLANG-NOTFOUND" )
set(USE_CLANG 0)
else()
set(CLANG_LIBRARY ${LIBCLANG})
set(CLANG_INCLUDE ${LIBCLANG_INCLUDE})
set( CLANG_BINARY ${CLANG_LIBRARY})
endif()
endif()
if (USE_CLANG)
message( "-- clang link line ${CLANG_LIBRARY} ")
message( "-- clang include path ${CLANG_INCLUDE} ")
message( "-- clang binary ${CLANG_BINARY}" )
message( "-- CL_SRC_ROOT is set to => " ${CL_SRC_ROOT} )
message( "-- PREFIX is set to => " ${CL_PREFIX} )
message( "-- PREFIX/LIB_DIR is set to => " ${CL_PREFIX}/${CL_INSTALL_LIBDIR} )
message( "-- PLUGINS_DIR is set to => " ${PLUGINS_DIR} )
message( "-- wx-config is set to => " ${WX_TOOL} )
else()
message( "-- *** NOTICE ***: clang code completion support is disabled" )
message( "-- *** NOTICE ***: On Ubuntu / Debian you might want to install libclang-3.4-dev package")
endif()
else()
message( "-- *** NOTICE ***: clang code completion support is disabled" )
endif(USE_CLANG)
############################################
## SFTP support
############################################
if (WITH_SFTP)
## Default is set to 1
add_definitions(-DUSE_SFTP=1)
message("-- USE_SFTP is set to 1")
else(WITH_SFTP)
add_definitions(-DUSE_SFTP=0)
message("-- USE_SFTP is set to 0")
message( "-- *** NOTICE ***: SFTP support is disabled " )
endif(WITH_SFTP)
###########################################
## RPATH settings
###########################################
if (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH ${PLUGINS_DIR})
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif(UNIX AND NOT APPLE)
if ( WITH_PCH )
set( USE_PCH 1 )
endif( WITH_PCH )
unset(WITH_PCH CACHE)
###########################################
## Add the folders, the order matters here
###########################################
if ( USE_PCH )
add_subdirectory(PCH)
endif ( USE_PCH )
if ( APPLE )
add_definitions( -mmacosx-version-min=10.8 )
endif()
add_subdirectory(sqlite3)
add_subdirectory(sdk/wxsqlite3)
add_subdirectory(sdk/wxshapeframework)
add_subdirectory(sdk/databaselayer)
add_subdirectory(CodeLite)
add_subdirectory(Plugin)
add_subdirectory(abbreviation)
if ( NOT NO_CPP_PLUGINS )
add_subdirectory(CallGraph)
add_subdirectory(ContinuousBuild)
add_subdirectory(Debugger)
add_subdirectory(Gizmos)
add_subdirectory(Outline)
add_subdirectory(QmakePlugin)
add_subdirectory(UnitTestCPP)
add_subdirectory(cppchecker)
add_subdirectory(cscope)
add_subdirectory(wxformbuilder)
if ( UNIX AND NOT APPLE )
## Add valgrind plugin
add_subdirectory(MemCheck)
endif ( UNIX AND NOT APPLE )
if(IS_DIRECTORY "${CL_SRC_ROOT}/wxcrafter")
add_subdirectory(wxcrafter)
endif()
if ( APPLE )
message("-- Adding MacBundler...")
add_subdirectory(MacBundler)
endif ( APPLE )
endif ( NOT NO_CPP_PLUGINS )
add_subdirectory(Tweaks)
add_subdirectory(CodeFormatter)
add_subdirectory(Copyright)
add_subdirectory(DatabaseExplorer)
add_subdirectory(ExternalTools)
add_subdirectory(SnipWiz)
add_subdirectory(Subversion2)
add_subdirectory(ZoomNavigator)
add_subdirectory(git)
add_subdirectory(CMakePlugin)
add_subdirectory(CodeLiteDiff)
add_subdirectory(SpellChecker)
if (WITH_SFTP)
add_subdirectory(SFTP)
endif(WITH_SFTP)
if (WITH_LLDB)
add_subdirectory(LLDBDebugger)
endif()
add_subdirectory(codelitephp)
add_subdirectory(WordCompletion)
## Executables
add_subdirectory(LiteEditor)
add_subdirectory(codelitegcc)
add_subdirectory(codelite_make)
add_subdirectory(codelite_terminal)
add_subdirectory(sdk/codelite_indexer)
add_subdirectory(sdk/codelite_cppcheck)
add_subdirectory(codelite_echo)
add_subdirectory(WebTools)
##
## Setup the proper dependencies
##
if ( USE_PCH )
add_dependencies(sqlite3lib ${CL_PCH_TARGET})
endif ( USE_PCH )
add_dependencies(wxsqlite3 sqlite3lib)
add_dependencies(databaselayersqlite wxsqlite3)
add_dependencies(wxshapeframework wxsqlite3)
add_dependencies(libcodelite wxshapeframework databaselayersqlite wxsqlite3)
add_dependencies(plugin libcodelite)
add_dependencies(codelite plugin)
## Include our custom plugin.cmake module
include(plugin)
## Scan for user plugins
CL_SCAN_FOR_PLUGINS()
# Don't unset this earlier: it would affect the plugins' CMakeLists.txts
unset(PREFIX CACHE)