mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-05 13:26:53 +08:00
Merge pull request #220 from twelve17/ios_build
Patch for compatibility with openalpr-ios 2_0
This commit is contained in:
@@ -52,18 +52,37 @@ IF (WIN32 AND WITH_DAEMON)
|
|||||||
SET(WITH_DAEMON OFF)
|
SET(WITH_DAEMON OFF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE( Tesseract REQUIRED )
|
IF(Tesseract_FRAMEWORK_PATH AND Leptonica_FRAMEWORK_PATH)
|
||||||
|
MESSAGE(STATUS "Using Tesseract iOS framework: ${Tesseract_FRAMEWORK_PATH}")
|
||||||
|
MESSAGE(STATUS "Using Leptonica iOS framework: ${Leptonica_FRAMEWORK_PATH}")
|
||||||
|
# http://www.vtk.org/Wiki/CMake:HowToUseExistingOSXFrameworks
|
||||||
|
SET(Tesseract_LIBRARIES "${Tesseract_FRAMEWORK_PATH};${Leptonica_FRAMEWORK_PATH}")
|
||||||
|
SET(Tesseract_INCLUDE_DIRS "${Tesseract_FRAMEWORK_PATH}/Headers")
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE( Tesseract REQUIRED )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
include_directories(${Tesseract_INCLUDE_DIRS})
|
include_directories(${Tesseract_INCLUDE_DIRS})
|
||||||
|
|
||||||
# Discover OpenCV directory automatically
|
IF(OpenCV_FRAMEWORK_PATH)
|
||||||
find_path(OpenCV_DIR
|
MESSAGE(STATUS "Using OpenCV iOS framework: ${OpenCV_FRAMEWORK_PATH}")
|
||||||
|
SET(OpenCV_INCLUDE_DIRS "${OpenCV_FRAMEWORK_PATH}/Headers")
|
||||||
|
SET(OpenCV_LIBS ${OpenCV_FRAMEWORK_PATH})
|
||||||
|
|
||||||
|
# OpenCV's released framework has this disabled, so we must too.
|
||||||
|
# http://stackoverflow.com/a/32710441/868173
|
||||||
|
SET(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO)
|
||||||
|
ELSE()
|
||||||
|
# Discover OpenCV directory automatically
|
||||||
|
find_path(OpenCV_DIR
|
||||||
NAMES OpenCVConfig.cmake
|
NAMES OpenCVConfig.cmake
|
||||||
HINTS ${CMAKE_SOURCE_DIR}/../libraries/opencv/
|
HINTS ${CMAKE_SOURCE_DIR}/../libraries/opencv/
|
||||||
/storage/projects/alpr/libraries/opencv/
|
/storage/projects/alpr/libraries/opencv/
|
||||||
)
|
)
|
||||||
# Opencv Package
|
# Opencv Package
|
||||||
FIND_PACKAGE( OpenCV REQUIRED )
|
FIND_PACKAGE( OpenCV REQUIRED )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (${OpenCV_VERSION} VERSION_LESS 2.4.7)
|
IF (${OpenCV_VERSION} VERSION_LESS 2.4.7)
|
||||||
MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
|
MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -94,7 +113,9 @@ ENDIF()
|
|||||||
|
|
||||||
|
|
||||||
set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ")
|
set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ")
|
||||||
ADD_EXECUTABLE( alpr main.cpp )
|
if (NOT IOS)
|
||||||
|
ADD_EXECUTABLE( alpr main.cpp )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
SET(OPENALPR_LIB openalpr-static)
|
SET(OPENALPR_LIB openalpr-static)
|
||||||
@@ -102,7 +123,8 @@ ELSE()
|
|||||||
SET(OPENALPR_LIB openalpr)
|
SET(OPENALPR_LIB openalpr)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(alpr
|
if (NOT IOS)
|
||||||
|
TARGET_LINK_LIBRARIES(alpr
|
||||||
${OPENALPR_LIB}
|
${OPENALPR_LIB}
|
||||||
statedetection
|
statedetection
|
||||||
support
|
support
|
||||||
@@ -111,6 +133,7 @@ TARGET_LINK_LIBRARIES(alpr
|
|||||||
${Tesseract_LIBRARIES}
|
${Tesseract_LIBRARIES}
|
||||||
${Extra_LIBS}
|
${Extra_LIBS}
|
||||||
)
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Compile the alprd library on Unix-based OS
|
# Compile the alprd library on Unix-based OS
|
||||||
IF (WITH_DAEMON)
|
IF (WITH_DAEMON)
|
||||||
@@ -149,8 +172,10 @@ if (WITH_BINDING_PYTHON)
|
|||||||
add_subdirectory(bindings/python)
|
add_subdirectory(bindings/python)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
install (TARGETS alpr DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
if (NOT IOS)
|
||||||
install (FILES ${CMAKE_SOURCE_DIR}/../doc/man/alpr.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 COMPONENT doc)
|
install (TARGETS alpr DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
install (FILES ${CMAKE_SOURCE_DIR}/../doc/man/alpr.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 COMPONENT doc)
|
||||||
|
ENDIF()
|
||||||
install (DIRECTORY ${CMAKE_SOURCE_DIR}/../runtime_data DESTINATION ${CMAKE_INSTALL_PREFIX}/share/openalpr)
|
install (DIRECTORY ${CMAKE_SOURCE_DIR}/../runtime_data DESTINATION ${CMAKE_INSTALL_PREFIX}/share/openalpr)
|
||||||
|
|
||||||
# set runtime_data to reflect the current CMAKE_INSTALL_PREFIX
|
# set runtime_data to reflect the current CMAKE_INSTALL_PREFIX
|
||||||
|
@@ -8,7 +8,7 @@ set(statedetector_source_files
|
|||||||
state_detector_impl.cpp
|
state_detector_impl.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32 OR IOS)
|
||||||
add_library(statedetection STATIC ${statedetector_source_files} )
|
add_library(statedetection STATIC ${statedetector_source_files} )
|
||||||
ELSE()
|
ELSE()
|
||||||
add_library(statedetection SHARED ${statedetector_source_files} )
|
add_library(statedetection SHARED ${statedetector_source_files} )
|
||||||
|
Reference in New Issue
Block a user