Skip to content

If you want use cross compile to build. Confer CMakeText as flows: #7

Description

@jasonpp

cmake_minimum_required(VERSION 3.9)
project(imutils_cpp VERSION 1.0.1 DESCRIPTION "imutils_cpp A series of convenience functions to make basic image processing functions such as translation, rotation, resizing and skeletonization easier with OpenCV ")
#find_package(OpenCV REQUIRED)
include(GNUInstallDirs)
add_library(imutils_cpp SHARED src/text.cpp include/imutils/text.h src/paths.cpp include/imutils/paths.h src/perspective.cpp include/imutils/perspective.h src/convenience.cpp include/imutils/convenience.h)

set(OpenCV_DIR "/home/ps/Desktop/opencv-proejct/opencv-3.4.16/_build/")
set(OpenCV_LIBS "/home/ps/Desktop/opencv-proejct/opencv-3.4.16/_output/lib/")
set(OpenCV_INCLUDE_DIRS "/home/ps/Desktop/opencv-proejct/opencv-3.4.16/_output/include/")

set(CURL_DIR "/home/ps/Downloads/curl-7.37.1/output/bin/")
set(CURL_LIBS "/home/ps/Downloads/curl-7.37.1/output/lib/")
set(CURL_INCLUDE_DIRS "/home/ps/Downloads/curl-7.37.1/output/include/")

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})

set_target_properties(imutils_cpp PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(imutils_cpp PRIVATE include)
target_include_directories(imutils_cpp PRIVATE src)
include(GNUInstallDirs)
install(TARGETS imutils_cpp
${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME})
target_link_libraries(imutils_cpp ${OpenCV_LIBS} ${CURL_LIBS})

***Caution

  1. Change “/home/ps/Downloads” to your own path.
  2. add_library(imutils_cpp SHARED src/text.cpp include/imutils/text.h src/paths.cpp include/imutils/paths.h src/perspective.cpp --> If I use STATIC after SHARED then I got only static lib after I install to my lib directory. I dont konw where the bug come from and I dismissed STATIC keyword then I got .a & .so file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions