Commit 4a4c6882e1e3aeca8ef1c377a514d2b0c3918475
1 parent
4650acf7
automatically build dlib by default
Showing
5 changed files
with
15 additions
and
6 deletions
.gitignore
CMakeLists.txt
openbr/plugins/classification/dlib.cpp
| ... | ... | @@ -2,11 +2,13 @@ |
| 2 | 2 | #include "openbr/core/qtutils.h" |
| 3 | 3 | #include "openbr/core/eigenutils.h" |
| 4 | 4 | |
| 5 | +#define DLIB_NO_GUI_SUPPORT | |
| 5 | 6 | #include <dlib/image_processing/frontal_face_detector.h> |
| 6 | 7 | #include <dlib/svm_threaded.h> |
| 7 | 8 | #include <dlib/image_processing.h> |
| 8 | 9 | #include <dlib/image_io.h> |
| 9 | 10 | #include <dlib/opencv.h> |
| 11 | +#include <dlib/all/source.cpp> | |
| 10 | 12 | |
| 11 | 13 | #include <QTemporaryFile> |
| 12 | 14 | ... | ... |
openbr/plugins/cmake/dlib.cmake
| 1 | -set(BR_WITH_DLIB OFF CACHE BOOL "Build with DLib") | |
| 1 | +set(BR_WITH_DLIB ON CACHE BOOL "Build with DLib") | |
| 2 | 2 | |
| 3 | 3 | if(${BR_WITH_DLIB}) |
| 4 | - find_package(DLib REQUIRED) | |
| 5 | - add_definitions(-DDLIB_NO_GUI_SUPPORT) | |
| 6 | - set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} ${DLib_DIR}/dlib/all/source.cpp) | |
| 7 | - install(DIRECTORY ${DLib_DIR}/models/ DESTINATION share/openbr/models/dlib) | |
| 4 | + ExternalProject_Add(dlib | |
| 5 | + URL http://downloads.sourceforge.net/project/dclib/dlib/v18.16/dlib-18.16.tar.bz2 | |
| 6 | + URL_MD5 e9e5449bc25370afce2d254327afac99 | |
| 7 | + SOURCE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/dlib-18.16" | |
| 8 | + CONFIGURE_COMMAND "" | |
| 9 | + BUILD_COMMAND "" | |
| 10 | + INSTALL_COMMAND "") | |
| 11 | + include_directories("${CMAKE_SOURCE_DIR}/3rdparty/dlib-18.16") | |
| 8 | 12 | else() |
| 9 | 13 | set(BR_EXCLUDED_PLUGINS ${BR_EXCLUDED_PLUGINS} plugins/classification/dlib.cpp) |
| 10 | 14 | endif() | ... | ... |