CMakeLists.txt 20.4 KB
Newer Older
1
2
3
4
5
#
# This is a CMake makefile.  You can find the cmake utility and
# information about it at http://www.cmake.org
#

6
# setting this makes CMake allow normal looking if else statements
7
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
8

9
cmake_minimum_required(VERSION 2.4)
10
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
11

12
13
14
# default to a Release build (except if CMAKE_BUILD_TYPE is set)
include(release_build_by_default)

15
16
17
project(dlib)

set(CPACK_PACKAGE_VERSION_MAJOR "18")
Davis King's avatar
Davis King committed
18
set(CPACK_PACKAGE_VERSION_MINOR "18")
19
set(CPACK_PACKAGE_VERSION_PATCH "99")
20
set(VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
21

22
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
23
# Suppress cmake warnings about changes in new versions.
24
25
if(COMMAND cmake_policy) 
   cmake_policy(SET CMP0003 NEW) 
26
27
28
   if (POLICY CMP0054)
      cmake_policy(SET CMP0054 NEW)
   endif()
29
endif()
30

31
include(add_global_compiler_switch.cmake)
32
33
34
35
36
37
38
39
40


# Make sure ENABLE_ASSERTS is defined for debug builds
if (NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-DENABLE_ASSERTS")
   set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_ASSERTS" 
      CACHE STRING "Flags used by the compiler during C++ debug builds." 
      FORCE)
endif ()

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Don't try to call add_library(dlib) and setup dlib's stuff if it has already
# been done by some other part of the current cmake project.  We do this
# because it avoids getting warnings/errors about cmake policy CMP0002.  This
# happens when a project tries to call add_subdirectory() on dlib more than
# once.  This most often happens when the top level of a project depends on two
# or more other things which both depend on dlib. 
if (NOT TARGET dlib)

   set (DLIB_ISO_CPP_ONLY_STR 
   "Enable this if you don't want to compile any non-ISO C++ code (i.e. you don't use any of the API Wrappers)" )
   set (DLIB_NO_GUI_SUPPORT_STR 
   "Enable this if you don't want to compile any of the dlib GUI code" )
   set (DLIB_ENABLE_STACK_TRACE_STR 
   "Enable this if you want to turn on the DLIB_STACK_TRACE macros" )
   set (DLIB_ENABLE_ASSERTS_STR 
   "Enable this if you want to turn on the DLIB_ASSERT macro" )
   set (DLIB_USE_BLAS_STR
   "Disable this if you don't want to use a BLAS library" )
   set (DLIB_USE_LAPACK_STR
   "Disable this if you don't want to use a LAPACK library" )
61
   set (DLIB_PNG_SUPPORT_STR
62
   "Disable this if you don't want to link against libpng" )
63
   set (DLIB_JPEG_SUPPORT_STR
64
65
66
   "Disable this if you don't want to link against libjpeg" )
   set (DLIB_LINK_WITH_SQLITE3_STR
   "Disable this if you don't want to link against sqlite3" )
67
   #set (DLIB_USE_FFTW_STR "Disable this if you don't want to link against fftw" )
68
69
70
71

   option(DLIB_ISO_CPP_ONLY ${DLIB_ISO_CPP_ONLY_STR} OFF)
   option(DLIB_NO_GUI_SUPPORT ${DLIB_NO_GUI_SUPPORT_STR} OFF)
   option(DLIB_ENABLE_STACK_TRACE ${DLIB_ENABLE_STACK_TRACE_STR} OFF)
72

73
74
75
76
77
78
79
   option(DLIB_ENABLE_ASSERTS ${DLIB_ENABLE_ASSERTS_STR} OFF)

   if(DLIB_ENABLE_ASSERTS)
       set (DLIB_DISABLE_ASSERTS false)
       set (ENABLE_ASSERTS true) # we need the CMake variable to properly configure config.h.in
   else()
       set (DLIB_DISABLE_ASSERTS true)
80
81
   endif()

82
83
   option(DLIB_USE_BLAS ${DLIB_USE_BLAS_STR} ON)
   option(DLIB_USE_LAPACK ${DLIB_USE_LAPACK_STR} ON)
84
85
   option(DLIB_PNG_SUPPORT ${DLIB_PNG_SUPPORT_STR} ON)
   option(DLIB_JPEG_SUPPORT ${DLIB_JPEG_SUPPORT_STR} ON)
86
   option(DLIB_LINK_WITH_SQLITE3 ${DLIB_LINK_WITH_SQLITE3_STR} ON)
87
   #option(DLIB_USE_FFTW ${DLIB_USE_FFTW_STR} ON)
88

89
90
91
92
93
94
95
96
97
98
99
100
101
   set(source_files 
         base64/base64_kernel_1.cpp
         bigint/bigint_kernel_1.cpp
         bigint/bigint_kernel_2.cpp
         bit_stream/bit_stream_kernel_1.cpp
         entropy_decoder/entropy_decoder_kernel_1.cpp
         entropy_decoder/entropy_decoder_kernel_2.cpp
         entropy_encoder/entropy_encoder_kernel_1.cpp
         entropy_encoder/entropy_encoder_kernel_2.cpp
         md5/md5_kernel_1.cpp
         tokenizer/tokenizer_kernel_1.cpp
         unicode/unicode.cpp
         data_io/image_dataset_metadata.cpp)
102

103
   if (DLIB_ISO_CPP_ONLY)
104
       add_library(dlib STATIC ${source_files} )
105
       if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
106
           add_library(dlib-shared SHARED ${source_files} )
107
       endif()
108
   else()
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

      set(source_files ${source_files}
         sockets/sockets_kernel_1.cpp
         bsp/bsp.cpp
         dir_nav/dir_nav_kernel_1.cpp
         dir_nav/dir_nav_kernel_2.cpp
         dir_nav/dir_nav_extensions.cpp
         linker/linker_kernel_1.cpp
         logger/extra_logger_headers.cpp
         logger/logger_kernel_1.cpp
         logger/logger_config_file.cpp
         misc_api/misc_api_kernel_1.cpp
         misc_api/misc_api_kernel_2.cpp
         sockets/sockets_extensions.cpp
         sockets/sockets_kernel_2.cpp
         sockstreambuf/sockstreambuf.cpp
         sockstreambuf/sockstreambuf_unbuffered.cpp
         server/server_kernel.cpp
         server/server_iostream.cpp
         server/server_http.cpp
         threads/multithreaded_object_extension.cpp
         threads/threaded_object_extension.cpp
         threads/threads_kernel_1.cpp
         threads/threads_kernel_2.cpp
         threads/threads_kernel_shared.cpp
         threads/thread_pool_extension.cpp
         timer/timer.cpp
         stack_trace.cpp
         )

139
140
141
      # we want to link to the right stuff depending on our platform.  
      if (WIN32 AND NOT CYGWIN) ###############################################################################
         if (DLIB_NO_GUI_SUPPORT)
142
            set (dlib_needed_libraries ws2_32 winmm)
143
         else()
144
            set (dlib_needed_libraries ws2_32 winmm comctl32 gdi32 imm32)
145
146
147
148
149
150
151
         endif()
      elseif(APPLE) ############################################################################
         find_library(pthreadlib pthread)
         set (dlib_needed_libraries ${pthreadlib})

         if (NOT DLIB_NO_GUI_SUPPORT)
            find_library(xlib X11)
Davis King's avatar
Davis King committed
152
153
154
155
            # Make sure X11 is in the include path.  Note that we look for
            # Xlocale.h rather than Xlib.h because it avoids finding a partial
            # copy of the X11 headers on systems with anaconda installed.
            find_path(xlib_path Xlocale.h
156
157
               PATHS 
               /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
Davis King's avatar
Davis King committed
158
               /opt/local/include
159
160
161
162
163
164
165
               PATH_SUFFIXES X11
               )
            if (xlib AND xlib_path)
               get_filename_component(x11_path ${xlib_path} PATH CACHE)
               include_directories(${x11_path})
               set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} )
            else()
166
167
               message(" *****************************************************************************")
               message(" *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***")
168
169
               message(" *** Make sure XQuartz is installed if you want GUI support.               ***")
               message(" *** You can download XQuartz from: http://xquartz.macosforge.org/landing/ ***")
170
               message(" *****************************************************************************")
171
172
               set(DLIB_NO_GUI_SUPPORT ON CACHE STRING ${DLIB_NO_GUI_SUPPORT_STR} FORCE )
            endif()
173
174
         endif()

175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
         mark_as_advanced(pthreadlib xlib xlib_path x11_path)
      else () ##################################################################################
         find_library(pthreadlib pthread)
         set (dlib_needed_libraries ${pthreadlib})

         # link to the nsl library if it exists.  this is something you need sometimes 
         find_library(nsllib nsl)
         if (nsllib)
            set (dlib_needed_libraries ${dlib_needed_libraries} ${nsllib})
         endif ()

         # link to the socket library if it exists.  this is something you need on solaris
         find_library(socketlib socket)
         if (socketlib)
            set (dlib_needed_libraries ${dlib_needed_libraries} ${socketlib})
         endif ()

         if (NOT DLIB_NO_GUI_SUPPORT)
            include(FindX11)
            if (X11_FOUND)
               include_directories(${X11_INCLUDE_DIR})
               set (dlib_needed_libraries ${dlib_needed_libraries} ${X11_LIBRARIES})
            else()
198
199
               message(" *****************************************************************************")
               message(" *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***")
200
201
               message(" *** Make sure libx11-dev is installed if you want GUI support.            ***")
               message(" *** On Ubuntu run: sudo apt-get install libx11-dev                        ***")
202
               message(" *****************************************************************************")
203
204
               set(DLIB_NO_GUI_SUPPORT ON CACHE STRING ${DLIB_NO_GUI_SUPPORT_STR} FORCE )
            endif()
205
206
         endif()

207
208
         mark_as_advanced(nsllib pthreadlib socketlib)
      endif () ##################################################################################
209

210
211
212
213
214
215
216
217
218
219
220
221
      if (NOT DLIB_NO_GUI_SUPPORT)
         set(source_files ${source_files}
            gui_widgets/fonts.cpp
            gui_widgets/widgets.cpp
            gui_widgets/drawable.cpp
            gui_widgets/canvas_drawing.cpp
            gui_widgets/style.cpp
            gui_widgets/base_widgets.cpp
            gui_core/gui_core_kernel_1.cpp
            gui_core/gui_core_kernel_2.cpp
            )
      endif()
222

223
      INCLUDE (CheckFunctionExists)
224

225
      if (DLIB_PNG_SUPPORT)
226
         # try to find libpng 
Davis King's avatar
Davis King committed
227
         find_package(PNG QUIET)
228
229
         # Make sure there isn't something wrong with the version of LIBPNG
         # installed on this system.  
230
231
232
233
         if (PNG_FOUND)
            set(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARY})
            CHECK_FUNCTION_EXISTS(png_create_read_struct LIBPNG_IS_GOOD)
         endif()
234
         if (PNG_FOUND AND LIBPNG_IS_GOOD)
235
236
237
            include_directories(${PNG_INCLUDE_DIR})
            set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARY})
         else()
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
            # If we can't find libpng then statically compile it in.
            include_directories(external/libpng external/zlib)
            set(source_files ${source_files}
               external/libpng/png.c
               external/libpng/pngerror.c
               external/libpng/pngget.c
               external/libpng/pngmem.c
               external/libpng/pngpread.c
               external/libpng/pngread.c
               external/libpng/pngrio.c
               external/libpng/pngrtran.c
               external/libpng/pngrutil.c
               external/libpng/pngset.c
               external/libpng/pngtrans.c
               external/libpng/pngwio.c
               external/libpng/pngwrite.c
               external/libpng/pngwtran.c
               external/libpng/pngwutil.c
               external/zlib/adler32.c
               external/zlib/compress.c
               external/zlib/crc32.c
               external/zlib/deflate.c
               external/zlib/gzclose.c
               external/zlib/gzlib.c
               external/zlib/gzread.c
               external/zlib/gzwrite.c
               external/zlib/infback.c
               external/zlib/inffast.c
               external/zlib/inflate.c
               external/zlib/inftrees.c
               external/zlib/trees.c
               external/zlib/uncompr.c
               external/zlib/zutil.c
               )
272
         endif()
273
274
275
276
         set(source_files ${source_files}
            image_loader/png_loader.cpp
            image_saver/save_png.cpp
            )
277
      endif()
278

279
      if (DLIB_JPEG_SUPPORT)
280
         # try to find libjpeg 
281
         find_package(JPEG QUIET)
282
         # Make sure there isn't something wrong with the version of libjpeg 
283
284
         # installed on this system.  Also don't use the installed libjpeg
         # if this is an APPLE system because apparently it's broken (as of 2015/01/01).
285
286
287
288
         if (JPEG_FOUND)
            set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
            CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD)
         endif()
289
         if (JPEG_FOUND AND LIBJPEG_IS_GOOD AND NOT APPLE)
290
291
292
            include_directories(${JPEG_INCLUDE_DIR})
            set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY})
         else()
293
            # If we can't find libjpeg then statically compile it in.
294
            add_definitions(-DDLIB_JPEG_STATIC)
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
            set(source_files ${source_files}
                  external/libjpeg/jcomapi.cpp
                  external/libjpeg/jdapimin.cpp
                  external/libjpeg/jdapistd.cpp
                  external/libjpeg/jdatasrc.cpp
                  external/libjpeg/jdcoefct.cpp
                  external/libjpeg/jdcolor.cpp
                  external/libjpeg/jddctmgr.cpp
                  external/libjpeg/jdhuff.cpp
                  external/libjpeg/jdinput.cpp
                  external/libjpeg/jdmainct.cpp
                  external/libjpeg/jdmarker.cpp
                  external/libjpeg/jdmaster.cpp
                  external/libjpeg/jdmerge.cpp
                  external/libjpeg/jdphuff.cpp
                  external/libjpeg/jdpostct.cpp
                  external/libjpeg/jdsample.cpp
                  external/libjpeg/jerror.cpp
                  external/libjpeg/jidctflt.cpp
                  external/libjpeg/jidctfst.cpp
                  external/libjpeg/jidctint.cpp
                  external/libjpeg/jidctred.cpp
                  external/libjpeg/jmemmgr.cpp
                  external/libjpeg/jmemnobs.cpp
                  external/libjpeg/jquant1.cpp
                  external/libjpeg/jquant2.cpp
Davis King's avatar
Davis King committed
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
                  external/libjpeg/jutils.cpp  
                  external/libjpeg/jcapimin.cpp
                  external/libjpeg/jdatadst.cpp
                  external/libjpeg/jcparam.cpp
                  external/libjpeg/jcapistd.cpp
                  external/libjpeg/jcmarker.cpp
                  external/libjpeg/jcinit.cpp
                  external/libjpeg/jcmaster.cpp
                  external/libjpeg/jcdctmgr.cpp
                  external/libjpeg/jccoefct.cpp  
                  external/libjpeg/jccolor.cpp  
                  external/libjpeg/jchuff.cpp  
                  external/libjpeg/jcmainct.cpp  
                  external/libjpeg/jcphuff.cpp  
                  external/libjpeg/jcprepct.cpp  
                  external/libjpeg/jcsample.cpp
                  external/libjpeg/jfdctint.cpp
                  external/libjpeg/jfdctflt.cpp
                  external/libjpeg/jfdctfst.cpp
                  )
341
         endif()
342
343
         set(source_files ${source_files}
            image_loader/jpeg_loader.cpp
Davis King's avatar
Davis King committed
344
            image_saver/save_jpeg.cpp
345
            )
346
347
      endif()

348

349
350
351
      if (DLIB_USE_BLAS OR DLIB_USE_LAPACK)
         # Try to find BLAS and LAPACK 
         include(cmake_find_blas.txt)
352

353
354
355
356
357
358
         if (DLIB_USE_BLAS)
            if (blas_found)
               set (dlib_needed_libraries ${dlib_needed_libraries} ${blas_libraries})
            else()
               set(DLIB_USE_BLAS OFF CACHE STRING ${DLIB_USE_BLAS_STR} FORCE )
            endif()
359
360
         endif()

361
362
363
364
365
366
         if (DLIB_USE_LAPACK)
            if (lapack_found)
               set (dlib_needed_libraries ${dlib_needed_libraries} ${lapack_libraries})
            else()
               set(DLIB_USE_LAPACK OFF CACHE STRING ${DLIB_USE_LAPACK_STR} FORCE )
            endif()
367
         endif()
368
369
370
      endif()


371

372
373
374
375
376
377
378
379
380
381
382
383
      if (DLIB_LINK_WITH_SQLITE3)
         find_library(sqlite sqlite3)
         # make sure sqlite3.h is in the include path
         find_path(sqlite_path sqlite3.h)
         if (sqlite AND sqlite_path)
            get_filename_component(sqlite_path2 ${sqlite_path} PATH CACHE)
            include_directories(${sqlite_path2})
            set(dlib_needed_libraries ${dlib_needed_libraries} ${sqlite} )
         else()
            set(DLIB_LINK_WITH_SQLITE3 OFF CACHE STRING ${DLIB_LINK_WITH_SQLITE3_STR} FORCE )
         endif()
         mark_as_advanced(sqlite sqlite_path sqlite_path2)
384
385
386
      endif()


387

388
      if (DLIB_USE_FFTW)
389
390
391
392
         find_library(fftw fftw3)
         # make sure fftw3.h is in the include path
         find_path(fftw_path fftw3.h)
         if (fftw AND fftw_path)
393
            include_directories(${fftw_path})
394
395
            set(dlib_needed_libraries ${dlib_needed_libraries} ${fftw} )
         else()
396
            set(DLIB_USE_FFTW OFF CACHE STRING ${DLIB_LINK_WITH_SQLITE3_STR} FORCE )
397
         endif()
398
         mark_as_advanced(fftw fftw_path)
399
400
      endif()

401
402
403
      add_library(dlib STATIC ${source_files} )
      target_link_libraries(dlib ${dlib_needed_libraries} )

404
      if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
405
406
          add_library(dlib-shared SHARED ${source_files} )
          target_link_libraries(dlib-shared ${dlib_needed_libraries} )
407
      endif()
408

409
   endif ()  ##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
410

411
   # Install the library
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
   if (NOT DLIB_IN_PROJECT_BUILD)
       if(UNIX)
           set_target_properties(dlib-shared PROPERTIES
                                        OUTPUT_NAME dlib 
                                        VERSION ${VERSION})
           install(TARGETS dlib dlib-shared
                   EXPORT dlib 
                   RUNTIME DESTINATION bin # Windows (including cygwin) considers .dll to be runtime artifacts
                   LIBRARY DESTINATION lib
                   ARCHIVE DESTINATION lib)
       else()
           install(TARGETS dlib
                   EXPORT dlib 
                   RUNTIME DESTINATION bin # Windows considers .dll to be runtime artifacts
                   LIBRARY DESTINATION lib
                   ARCHIVE DESTINATION lib)
       endif()
429
430
431
432
433

       install(DIRECTORY ${CMAKE_SOURCE_DIR}/ DESTINATION include/dlib
               FILES_MATCHING PATTERN "*.h"
               REGEX "${CMAKE_CURRENT_BINARY_DIR}" EXCLUDE)

434

Davis King's avatar
Davis King committed
435
       configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
436
437
438
       # overwrite config.h with the configured one
       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/dlib)

439
       configure_file(${PROJECT_SOURCE_DIR}/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/revision.h)
440
441
       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/revision.h DESTINATION include/dlib)

442
       install(FILES "LICENSE.txt" DESTINATION share/doc/dlib)
443

444
445
446
447
448
449
450
451
       ## Config.cmake generation and installation

       set(ConfigPackageLocation lib/cmake/dlib)
       install(EXPORT dlib
            NAMESPACE dlib::
            DESTINATION ${ConfigPackageLocation})

       set(CONF_INSTALL_PATH "\${dlib_CMAKE_DIR}/../../../")
452
       configure_file(dlibConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/config/dlibConfig.cmake" @ONLY)
453
454
455

       include(CMakePackageConfigHelpers)
       write_basic_package_version_file(
456
           "${CMAKE_CURRENT_BINARY_DIR}/config/dlibConfigVersion.cmake"
457
458
459
460
461
           VERSION ${VERSION}
           COMPATIBILITY AnyNewerVersion
           )

       install(FILES 
462
463
                    "${CMAKE_CURRENT_BINARY_DIR}/config/dlibConfig.cmake" 
                    "${CMAKE_CURRENT_BINARY_DIR}/config/dlibConfigVersion.cmake" 
464
               DESTINATION ${ConfigPackageLocation})
465
466
   endif()

467

468
469
470
   #test for some things that really should be true about the compiler
   include(TestForSTDNamespace)
   include(TestForANSIStreamHeaders)
471
472


473
   if (DLIB_PNG_SUPPORT AND NOT DLIB_ISO_CPP_ONLY)
474
475
476
477
      add_global_define(DLIB_PNG_SUPPORT)
   else()
      remove_global_define(DLIB_PNG_SUPPORT)
   endif()
478

479
   if (DLIB_JPEG_SUPPORT AND NOT DLIB_ISO_CPP_ONLY)
480
481
482
483
      add_global_define(DLIB_JPEG_SUPPORT)
   else()
      remove_global_define(DLIB_JPEG_SUPPORT)
   endif()
484

485
   if (DLIB_USE_FFTW AND NOT DLIB_ISO_CPP_ONLY)
486
487
488
489
490
      add_global_define(DLIB_USE_FFTW)
   else()
      remove_global_define(DLIB_USE_FFTW)
   endif()

491

492
493
494
495
496
   if (DLIB_USE_BLAS AND blas_found)
      add_global_define(DLIB_USE_BLAS)
   else()
      remove_global_define(DLIB_USE_BLAS)
   endif()
497

498
499
500
501
502
   if (DLIB_USE_LAPACK AND lapack_found)
      add_global_define(DLIB_USE_LAPACK)
   else()
      remove_global_define(DLIB_USE_LAPACK)
   endif()
503

504

505
506
507
508
509
   if (DLIB_ISO_CPP_ONLY)
      add_global_define(DLIB_ISO_CPP_ONLY)
   else()
      remove_global_define(DLIB_ISO_CPP_ONLY)
   endif()
510
511


512
513
514
515
516
   if (DLIB_NO_GUI_SUPPORT)
      add_global_define(DLIB_NO_GUI_SUPPORT)
   else()
      remove_global_define(DLIB_NO_GUI_SUPPORT)
   endif()
517

518
519
520
521
522
   if (DLIB_ENABLE_STACK_TRACE)
      add_global_define(DLIB_ENABLE_STACK_TRACE)
   else()
      remove_global_define(DLIB_ENABLE_STACK_TRACE)
   endif()
523
524


525
526
527
528
529
   if (DLIB_ENABLE_ASSERTS)
      add_global_define(ENABLE_ASSERTS)
   else()
      remove_global_define(ENABLE_ASSERTS)
   endif()
530

531
532

endif()