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


7
cmake_minimum_required(VERSION 2.8.4)
8

9
10
PROJECT(examples)

Davis King's avatar
Davis King committed
11
include(../dlib/cmake)
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Tell CMake to compile a program.  We do this with the ADD_EXECUTABLE()
# statement which takes the name of the output executable and then a list of
# .cpp files to compile.  Here each example consists of only one .cpp file but
# in general you will make programs that const of many .cpp files.
ADD_EXECUTABLE(assignment_learning_ex assignment_learning_ex.cpp)
# Then we tell it to link with dlib.
TARGET_LINK_LIBRARIES(assignment_learning_ex dlib)




# Since there are a lot of examples I'm going to use a macro to simply this
# CMakeLists.txt file.  However, usually you will create only one executable in
# your cmake projects and use the syntax shown above.
27
28
29
30
31
MACRO(add_example name)
   ADD_EXECUTABLE(${name} ${name}.cpp)
   TARGET_LINK_LIBRARIES(${name} dlib )
ENDMACRO()

32
33
34
35
36
37
38
39
40
# if an example requires GUI, call this macro to check DLIB_NO_GUI_SUPPORT to include or exclude
MACRO(add_gui_example name)
   if (DLIB_NO_GUI_SUPPORT)
      message("No GUI support, so we won't build the ${name} example.")
   else()
      add_example(${name})
   endif()
ENDMACRO()

Davis King's avatar
Davis King committed
41
42
# The deep learning toolkit requires a C++11 capable compiler.  
if (COMPILER_CAN_DO_CPP_11)
Davis King's avatar
Davis King committed
43
44
   add_example(dnn_introduction_ex)
   add_example(dnn_introduction2_ex)
Fm's avatar
Fm committed
45
   add_example(dnn_inception_ex)
46
47
   add_gui_example(dnn_imagenet_ex)
   add_gui_example(dnn_mmod_ex)
48
   add_gui_example(dnn_mmod_face_detection_ex)
49
   add_gui_example(random_cropper_ex)
50
   add_gui_example(dnn_mmod_dog_hipsterizer)
51
52
53
54
55
56
   if (NOT MSVC)
      # Don't try to compile this program using Visual Studio since it causes the
      # compiler to run out of RAM and to crash.  Maybe someday Visual Studio
      # won't be broken :(
      add_example(dnn_imagenet_train_ex)
   endif()
Davis King's avatar
Davis King committed
57
endif()
58
59

#here we apply our macros 
60
add_gui_example(3d_point_cloud_ex)
61
62
add_example(bayes_net_ex)
add_example(bayes_net_from_disk_ex)
63
add_gui_example(bayes_net_gui_ex)
64
add_example(bridge_ex)
Davis King's avatar
Davis King committed
65
add_example(bsp_ex)
66
add_example(compress_stream_ex)
67
add_example(config_reader_ex)
68
add_example(custom_trainer_ex)
69
add_example(dir_nav_ex)
70
add_example(empirical_kernel_map_ex)
71
72
73
74
add_gui_example(face_detection_ex)
add_gui_example(face_landmark_detection_ex)
add_gui_example(fhog_ex)
add_gui_example(fhog_object_detector_ex)
75
add_example(file_to_code_ex)
76
add_example(graph_labeling_ex)
77
78
79
add_gui_example(gui_api_ex)
add_gui_example(hough_transform_ex)
add_gui_example(image_ex)
Davis King's avatar
Davis King committed
80
add_example(integrate_function_adapt_simp_ex)
81
add_example(iosockstream_ex)
Davis King's avatar
Davis King committed
82
add_example(kcentroid_ex)
83
add_example(kkmeans_ex)
Davis King's avatar
Davis King committed
84
add_example(krls_ex)
85
add_example(krls_filter_ex)
86
87
add_example(krr_classification_ex)
add_example(krr_regression_ex)
88
add_example(learning_to_track_ex)
89
add_example(least_squares_ex)
90
add_example(linear_manifold_regularizer_ex)
91
add_example(logger_custom_output_ex)
92
93
94
add_example(logger_ex)
add_example(logger_ex_2)
add_example(matrix_ex)
95
add_example(matrix_expressions_ex)
96
add_example(max_cost_assignment_ex)
97
98
add_example(member_function_pointer_ex)
add_example(mlp_ex)
99
add_example(model_selection_ex)
100
add_gui_example(mpc_ex)
101
add_example(multiclass_classification_ex)
102
add_example(multithreaded_object_ex)
103
104
105
add_gui_example(object_detector_advanced_ex)
add_gui_example(object_detector_ex)
add_gui_example(one_class_classifiers_ex)
Davis King's avatar
Davis King committed
106
add_example(optimization_ex)
107
add_example(parallel_for_ex)
108
add_example(pipe_ex)
109
add_example(pipe_ex_2)
Davis King's avatar
Davis King committed
110
add_example(quantum_computing_ex)
111
add_example(queue_ex)
Davis King's avatar
Davis King committed
112
add_example(rank_features_ex)
Davis King's avatar
Davis King committed
113
add_example(running_stats_ex)
Davis King's avatar
Davis King committed
114
add_example(rvm_ex)
Davis King's avatar
Davis King committed
115
add_example(rvm_regression_ex)
116
add_example(sequence_labeler_ex)
117
add_example(sequence_segmenter_ex)
118
add_example(server_http_ex)
119
add_example(server_iostream_ex)
120
121
122
add_example(sockets_ex)
add_example(sockstreambuf_ex)
add_example(std_allocator_ex)
123
add_gui_example(surf_ex)
124
add_example(svm_c_ex)
125
add_example(svm_ex)
126
add_example(svm_pegasos_ex)
127
add_example(svm_rank_ex)
Davis King's avatar
Davis King committed
128
add_example(svm_sparse_ex)
129
add_example(svm_struct_ex)
Davis King's avatar
Davis King committed
130
add_example(svr_ex)
131
add_example(thread_function_ex)
Davis King's avatar
Davis King committed
132
add_example(thread_pool_ex)
133
add_example(threaded_object_ex)
134
135
add_example(threads_ex)
add_example(timer_ex)
136
add_gui_example(train_object_detector)
137
add_example(train_shape_predictor_ex)
138
add_example(using_custom_kernels_ex)
139
add_gui_example(video_tracking_ex)
140
add_example(xml_parser_ex)
141
142


143
144
if (DLIB_NO_GUI_SUPPORT)
   message("No GUI support, so we won't build the webcam_face_pose_ex example.")
145
else()
146
147
148
149
150
151
152
153
154
   find_package(OpenCV QUIET)
   if (OpenCV_FOUND)
      include_directories(${OpenCV_INCLUDE_DIRS})

      ADD_EXECUTABLE(webcam_face_pose_ex webcam_face_pose_ex.cpp)
      TARGET_LINK_LIBRARIES(webcam_face_pose_ex dlib ${OpenCV_LIBS} )
   else()
      message("OpenCV not found, so we won't build the webcam_face_pose_ex example.")
   endif()
155
156
157
endif()


158
159
160
161
if (DLIB_LINK_WITH_SQLITE3)
   add_example(sqlite_ex)
endif()

162