From 395a101e133910e0188a29a461e43e4a3d227d94 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 8 May 2014 05:58:01 -0500 Subject: [PATCH] Updated Linux compilation to link to OpenCV dynamically --- src/CMakeLists.txt | 2 +- src/openalpr/CMakeLists.txt | 4 ++-- src/openalpr/support/CMakeLists.txt | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c50a72f..39ccb77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,7 +54,7 @@ ADD_EXECUTABLE( alpr main.cpp ) TARGET_LINK_LIBRARIES(alpr - openalpr-static + openalpr support ${OpenCV_LIBS} ${Tesseract_LIBS} diff --git a/src/openalpr/CMakeLists.txt b/src/openalpr/CMakeLists.txt index 2b5f0c7..f76741a 100644 --- a/src/openalpr/CMakeLists.txt +++ b/src/openalpr/CMakeLists.txt @@ -35,12 +35,12 @@ add_subdirectory(support) add_library(openalpr-static STATIC ${lpr_source_files} ) add_library(openalpr SHARED ${lpr_source_files} ) -IF (WIN32) + TARGET_LINK_LIBRARIES(openalpr support ${OpenCV_LIBS} ${Tesseract_LIBS} ) -ENDIF() + # Add definition for default runtime dir add_definitions(-DDEFAULT_RUNTIME_DIR="${CMAKE_SOURCE_DIR}/../runtime_data/") \ No newline at end of file diff --git a/src/openalpr/support/CMakeLists.txt b/src/openalpr/support/CMakeLists.txt index 4cfbd6f..5516c67 100644 --- a/src/openalpr/support/CMakeLists.txt +++ b/src/openalpr/support/CMakeLists.txt @@ -5,5 +5,6 @@ set(support_source_files timing.cpp ) +add_library(support STATIC ${support_source_files}) -add_library(support ${support_source_files}) +SET_TARGET_PROPERTIES( support PROPERTIES COMPILE_FLAGS -fPIC) \ No newline at end of file