forked from biometrics/openbr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (65 loc) · 2.44 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
# Create version.h
configure_file(${BR_SHARE_DIR}/version.h.in version.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Collect source files
set(SRC openbr.cpp
openbr_plugin.cpp
universal_template.cpp)
aux_source_directory(core BR_CORE)
include(plugins/plugins.cmake)
# Janus API
option(BR_WITH_JANUS "Build IARPA Janus related applications." ON)
if(BR_WITH_JANUS)
include_directories(janus/include)
install(DIRECTORY janus/include DESTINATION .)
set(BR_JANUS janus.cpp
janus_io.cpp
janus/src/opencv_io/opencv_io.cpp)
add_definitions(-DJANUS_LIBRARY)
endif()
# Optional GUI module
if(NOT BR_EMBEDDED)
aux_source_directory(gui BR_GUI)
qt5_add_resources(BR_ICONS ../share/openbr/icons.qrc)
file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/gui/*.h)
install(FILES ${HEADERS} DESTINATION include/openbr/gui)
endif()
# Compile third party resources
if(BR_THIRDPARTY_RESOURCES)
qt5_add_resources(THIRDPARTY_RESOURCES ${BR_THIRDPARTY_RESOURCES})
endif()
add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES})
qt5_use_modules(openbr ${QT_DEPENDENCIES})
set_target_properties(openbr PROPERTIES
DEFINE_SYMBOL BR_LIBRARY
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
target_link_libraries(openbr ${BR_THIRDPARTY_LIBS})
add_cppcheck(openbr)
# Janus implementation
if(BR_WITH_JANUS)
set(JANUS_BUILD_PP5_WRAPPER ${BR_WITH_PP5} CACHE BOOL "Build Janus implementation using PittPatt 5")
set(JANUS_BUILD_DOCS ${BR_BUILD_DOCUMENTATION} CACHE BOOL "Build Janus HTML Doxygen documentation")
mark_as_advanced(JANUS_BUILD_PP5_WRAPPER)
mark_as_advanced(JANUS_BUILD_DOCS)
set(JANUS_IMPLEMENTATION openbr)
add_subdirectory(janus)
endif()
# Install
install(TARGETS openbr
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
if(NOT BR_EMBEDDED)
file(GLOB HEADERS *.h)
install(FILES ${HEADERS} DESTINATION include/openbr)
endif()
include(InstallDependencies)
install_compiler_libraries()
install_qt_libraries(QT_DEPENDENCIES)
if(NOT BR_EMBEDDED)
install_qt_imageformats()
endif()
install_qt_misc()
install_opencv_libraries(OPENCV_DEPENDENCIES)
install_ffmpeg()