From d008d6668dbbe0f594f2c7d57921978c48b68756 Mon Sep 17 00:00:00 2001 From: "Cody W. Eilar" Date: Sat, 2 Jul 2016 11:38:20 -0600 Subject: [PATCH] Add .deb package - Also fix additional warnings Signed-off-by: Cody W. Eilar --- CMakeLists.txt | 11 ++++++----- src/datatypes/CMakeLists.txt | 5 +---- src/experiments/CMakeLists.txt | 15 ++++++++------- src/experiments/overlap_add.cpp | 16 ++++++++-------- src/programs/CMakeLists.txt | 8 +++++--- src/readers/CMakeLists.txt | 1 + src/utilities/CMakeLists.txt | 7 ++++--- 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c29e444..f849a5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,9 @@ message("Gmock source dir is: ${gmock_SOURCE_DIR}") message("Celero source dir is: ${CeleroProject_SOURCE_DIR}") include_directories( - ${gtest_SOURCE_DIR}/include + ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR} - ${gmock_SOURCE_DIR}/include + ${gmock_SOURCE_DIR}/include ${gmock_SOURCE_DIR} ${CeleroProject_SOURCE_DIR}/include ${OpenCV_INCLUDE_DIRS} @@ -29,8 +29,9 @@ include_directories( ) add_subdirectory(src) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + SET(CPACK_GENERATOR "DEB") + SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Cody W. Eilar") #required +endif() -#SET(CPACK_GENERATOR "DEB") -#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Cody W. Eilar") #required INCLUDE(CPack) - diff --git a/src/datatypes/CMakeLists.txt b/src/datatypes/CMakeLists.txt index ec326fe..d8c1ca3 100644 --- a/src/datatypes/CMakeLists.txt +++ b/src/datatypes/CMakeLists.txt @@ -1,11 +1,10 @@ set(lib_name image) - # Google Tests add_executable(${lib_name}_tests tests/${lib_name}_tests.cpp) target_link_libraries(${lib_name}_tests - gtest gtest_main + gtest gtest_main ${OpenCV_LIBS}) add_test(NAME ${lib_name}_tests COMMAND ${lib_name}_tests) @@ -16,5 +15,3 @@ add_executable(${lib_name}_benchmark tests/${lib_name}_benchmark.cpp) target_link_libraries(${lib_name}_benchmark celero ${OpenCV_LIBS}) - - diff --git a/src/experiments/CMakeLists.txt b/src/experiments/CMakeLists.txt index 387f292..f8f5372 100644 --- a/src/experiments/CMakeLists.txt +++ b/src/experiments/CMakeLists.txt @@ -4,27 +4,28 @@ add_executable(${app_name}_benchmark overlap_add.cpp ${app_name}_benchmark.cpp) target_link_libraries(${app_name}_benchmark celero ${OpenCV_LIBS}) - + set(app_name overlap_add) # google test add_executable(${app_name}_tests tests/${app_name}_tests.cpp overlap_add.cpp ${app_name}.cpp) target_link_libraries(${app_name}_tests - gtest gtest_main + gtest gtest_main ${OpenCV_LIBS}) - +add_test(NAME ${app_name}_tests COMMAND ${app_name}_tests) + add_executable(${app_name}_benchmark tests/${app_name}_benchmark.cpp) target_link_libraries(${app_name}_benchmark celero ${OpenCV_LIBS}) -set(app_name dft) +set(app_name dft) add_executable(${app_name}_benchmark tests/${app_name}_benchmark.cpp) target_link_libraries(${app_name}_benchmark celero ${OpenCV_LIBS}) - -set(app_name optical_flow_mat_benchmark) + +set(app_name optical_flow_mat_benchmark) add_executable(${app_name} ${app_name}.cpp) target_link_libraries(${app_name} celero - ${OpenCV_LIBS}) \ No newline at end of file + ${OpenCV_LIBS}) diff --git a/src/experiments/overlap_add.cpp b/src/experiments/overlap_add.cpp index d6a9a20..97df849 100644 --- a/src/experiments/overlap_add.cpp +++ b/src/experiments/overlap_add.cpp @@ -16,17 +16,17 @@ namespace oflow { cv::UMat OverlapAdd(const cv::UMat &x_n, const cv::UMat &h_n, size_t L) { // N - auto n_row = h_n.rows + L - 1; // This should be nearest power of 2 - auto n_col = h_n.cols + L - 1; + size_t n_row = h_n.rows + L - 1; // This should be nearest power of 2 + size_t n_col = h_n.cols + L - 1; - auto nx_col = x_n.cols; - auto nx_row = x_n.rows; + size_t nx_col = x_n.cols; + size_t nx_row = x_n.rows; // M - auto m_kernel_row = h_n.rows; - auto m_kernel_col = h_n.cols; + size_t m_kernel_row = h_n.rows; + size_t m_kernel_col = h_n.cols; // Left and Bottom pads will be the same value as right and top. - auto top_pad = h_n.rows - 1; - auto right_pad = h_n.cols - 1; + size_t top_pad = h_n.rows - 1; + size_t right_pad = h_n.cols - 1; cv::UMat y = cv::UMat::zeros(m_kernel_row + nx_row - 1, m_kernel_col + nx_col - 1, x_n.type()); diff --git a/src/programs/CMakeLists.txt b/src/programs/CMakeLists.txt index 8fdad95..805384f 100644 --- a/src/programs/CMakeLists.txt +++ b/src/programs/CMakeLists.txt @@ -1,21 +1,23 @@ set(prog_name playback_video) - # Google Tests add_executable(${prog_name} ${prog_name}.cpp) +install(TARGETS ${prog_name} DESTINATION bin) target_link_libraries(${prog_name} ${OpenCV_LIBS} readers) - + set(prog_name extract_features) add_executable(${prog_name} ${prog_name}.cpp) target_link_libraries(${prog_name} ${OpenCV_LIBS} readers) +install(TARGETS ${prog_name} DESTINATION bin) set(prog_name farneback_flow) add_executable(${prog_name} ${prog_name}.cpp) target_link_libraries(${prog_name} ${OpenCV_LIBS} -) \ No newline at end of file +) +install(TARGETS ${prog_name} DESTINATION bin) diff --git a/src/readers/CMakeLists.txt b/src/readers/CMakeLists.txt index 22cc90a..76015e4 100644 --- a/src/readers/CMakeLists.txt +++ b/src/readers/CMakeLists.txt @@ -1,3 +1,4 @@ set(lib_name readers) add_library(${lib_name} STATIC video_file_reader.cpp) +install(TARGETS ${lib_name} DESTINATION lib) diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 4edd7ce..fcbb57f 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -1,12 +1,13 @@ set(lib_name utilities) add_library(${lib_name} STATIC utilities.cpp) +install(TARGETS ${lib_name} DESTINATION lib) add_executable(${lib_name}_tests tests/${lib_name}_tests.cpp) target_link_libraries(${lib_name}_tests - gtest gtest_main + gtest gtest_main ${OpenCV_LIBS}) - -add_test(NAME ${lib_name}_tests COMMAND ${lib_name}_tests) \ No newline at end of file + +add_test(NAME ${lib_name}_tests COMMAND ${lib_name}_tests)