mirror of
https://github.com/dyne/frei0r.git
synced 2025-12-05 22:29:59 +01:00
fix: WITHOUT_FACERECOGNITION build flag
to avoid double loading of protobuf, implicitly loaded by opencv, we need to deactivate the build of two face detection plugins that use opencv (which loads protobuf implicitly). This fixes bug #185
This commit is contained in:
11
BUILD.md
11
BUILD.md
@@ -10,6 +10,10 @@ The presence of optional libraries on the system will trigger compilation of ext
|
|||||||
|
|
||||||
+ [Cairo](http://cairographics.org) required for cairo- filters and mixers
|
+ [Cairo](http://cairographics.org) required for cairo- filters and mixers
|
||||||
|
|
||||||
|
## Optional build flags
|
||||||
|
|
||||||
|
+ `-DWITHOUT_FACERECOGNITION=ON` - Disable face recognition plugins (facedetect and facebl0r) to avoid protobuf conflicts with applications like MLT
|
||||||
|
|
||||||
It is recommended to use a separate `build` sub-folder.
|
It is recommended to use a separate `build` sub-folder.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -18,6 +22,13 @@ cd build && cmake ../
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To disable face recognition plugins (recommended when using with MLT):
|
||||||
|
```
|
||||||
|
mkdir -p build
|
||||||
|
cd build && cmake -DWITHOUT_FACERECOGNITION=ON ../
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
Also ninja and nmake are supported through cmake:
|
Also ninja and nmake are supported through cmake:
|
||||||
```
|
```
|
||||||
cmake -G 'Ninja' ../
|
cmake -G 'Ninja' ../
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ set (VERSION 2.5.1)
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
option (WITHOUT_OPENCV "Disable plugins dependent upon OpenCV" OFF)
|
option (WITHOUT_OPENCV "Disable plugins dependent upon OpenCV" OFF)
|
||||||
|
option (WITHOUT_FACERECOGNITION "Disable facedetect plugin to avoid protobuf conflicts" OFF)
|
||||||
|
|
||||||
if (NOT WITHOUT_OPENCV)
|
if (NOT WITHOUT_OPENCV)
|
||||||
find_package (OpenCV)
|
find_package (OpenCV)
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
set (SOURCES facebl0r.cpp)
|
# facebl0r filter - requires OpenCV (and protobuf)
|
||||||
set (TARGET facebl0r)
|
# This filter can cause conflicts with applications that also use protobuf
|
||||||
|
# such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON
|
||||||
|
|
||||||
if (MSVC)
|
if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION)
|
||||||
|
set (SOURCES facebl0r.cpp)
|
||||||
|
set (TARGET facebl0r)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
set (SOURCES ${SOURCES} ${FREI0R_DEF})
|
set (SOURCES ${SOURCES} ${FREI0R_DEF})
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
include_directories(${OpenCV_INCLUDE_DIRS})
|
include_directories(${OpenCV_INCLUDE_DIRS})
|
||||||
add_library (${TARGET} MODULE ${SOURCES})
|
add_library (${TARGET} MODULE ${SOURCES})
|
||||||
set_target_properties (${TARGET} PROPERTIES PREFIX "")
|
set_target_properties (${TARGET} PROPERTIES PREFIX "")
|
||||||
target_link_libraries(${TARGET} ${OpenCV_LIBS})
|
target_link_libraries(${TARGET} ${OpenCV_LIBS})
|
||||||
|
|
||||||
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
|
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
set (SOURCES facedetect.cpp)
|
# facedetect filter - requires OpenCV (and protobuf)
|
||||||
set (TARGET facedetect)
|
# This filter can cause conflicts with applications that also use protobuf
|
||||||
|
# such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON
|
||||||
|
|
||||||
if (MSVC)
|
if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION)
|
||||||
|
set (SOURCES facedetect.cpp)
|
||||||
|
set (TARGET facedetect)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
set (SOURCES ${SOURCES} ${FREI0R_DEF})
|
set (SOURCES ${SOURCES} ${FREI0R_DEF})
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
include_directories(${OpenCV_INCLUDE_DIRS})
|
include_directories(${OpenCV_INCLUDE_DIRS})
|
||||||
add_library (${TARGET} MODULE ${SOURCES})
|
add_library (${TARGET} MODULE ${SOURCES})
|
||||||
set_target_properties (${TARGET} PROPERTIES PREFIX "")
|
set_target_properties (${TARGET} PROPERTIES PREFIX "")
|
||||||
target_link_libraries(${TARGET} ${OpenCV_LIBS})
|
target_link_libraries(${TARGET} ${OpenCV_LIBS})
|
||||||
|
|
||||||
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
|
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user