2013-04-11 23:27:54 +08:00
|
|
|
SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_photo opencv_ml opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy)
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_check_dependencies(${OPENCV_HAARTRAINING_DEPS})
|
|
|
|
|
|
|
|
if(NOT OCV_DEPENDENCIES_FOUND)
|
|
|
|
return()
|
2012-01-25 17:04:49 +08:00
|
|
|
endif()
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
project(haartraining)
|
|
|
|
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_include_modules(${OPENCV_HAARTRAINING_DEPS})
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
if(WIN32)
|
2012-02-03 19:26:49 +08:00
|
|
|
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
link_libraries(${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
# Library
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
set(cvhaartraining_lib_src
|
2012-02-03 19:26:49 +08:00
|
|
|
_cvcommon.h
|
|
|
|
cvclassifier.h
|
|
|
|
_cvhaartraining.h
|
|
|
|
cvhaartraining.h
|
|
|
|
cvboost.cpp
|
|
|
|
cvcommon.cpp
|
|
|
|
cvhaarclassifier.cpp
|
|
|
|
cvhaartraining.cpp
|
|
|
|
cvsamples.cpp
|
|
|
|
)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
|
2011-04-30 18:42:33 +08:00
|
|
|
set_target_properties(opencv_haartraining_engine PROPERTIES
|
2012-02-03 19:26:49 +08:00
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
|
|
|
INSTALL_NAME_DIR lib
|
|
|
|
)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
# haartraining
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
|
|
|
|
add_executable(opencv_haartraining cvhaartraining.h haartraining.cpp)
|
|
|
|
set_target_properties(opencv_haartraining PROPERTIES
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
OUTPUT_NAME "opencv_haartraining")
|
|
|
|
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
# createsamples
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
|
|
|
|
add_executable(opencv_createsamples cvhaartraining.h createsamples.cpp)
|
|
|
|
set_target_properties(opencv_createsamples PROPERTIES
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
OUTPUT_NAME "opencv_createsamples")
|
|
|
|
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
# performance
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
add_executable(opencv_performance performance.cpp)
|
|
|
|
set_target_properties(opencv_performance PROPERTIES
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
OUTPUT_NAME "opencv_performance")
|
|
|
|
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
# Install part
|
|
|
|
# -----------------------------------------------------------
|
|
|
|
|
2013-08-07 16:53:48 +08:00
|
|
|
if(INSTALL_CREATE_DISTRIB)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
2014-01-17 20:30:31 +08:00
|
|
|
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
|
|
|
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
|
|
|
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
2013-08-07 16:53:48 +08:00
|
|
|
endif()
|
|
|
|
else()
|
2014-01-17 20:30:31 +08:00
|
|
|
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
|
|
|
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
|
|
|
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
2013-08-07 16:53:48 +08:00
|
|
|
endif()
|
2011-05-11 23:39:09 +08:00
|
|
|
|
2011-05-17 17:40:06 +08:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2012-02-03 19:26:49 +08:00
|
|
|
set_target_properties(opencv_performance PROPERTIES FOLDER "applications")
|
|
|
|
set_target_properties(opencv_createsamples PROPERTIES FOLDER "applications")
|
|
|
|
set_target_properties(opencv_haartraining PROPERTIES FOLDER "applications")
|
|
|
|
set_target_properties(opencv_haartraining_engine PROPERTIES FOLDER "applications")
|
2011-05-31 06:13:32 +08:00
|
|
|
endif()
|