From 9ee84536d5c56a063b4c416b71310754bd20dcc5 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 14:57:26 +0200 Subject: [PATCH 1/8] Ignore windows dependencies directory. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ec0ecc0..b94a828 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ build/ +windows/ scratch/ out/ debian_repo From 87ba3bd91aa982073d8cfe1daed6f42206e94e52 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 14:59:22 +0200 Subject: [PATCH 2/8] Add support for configuring if you want to enable build support for GPU detector. --- src/CMakeLists.txt | 4 ++++ src/openalpr/CMakeLists.txt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f1104f6..48e803e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,10 @@ IF ( NOT DEFINED WITH_DAEMON ) SET(WITH_DAEMON ON) ENDIF() +if ( NOT DEFINED WITH_GPU_DETECTOR ) + SET(WITH_GPU_DETECTOR OFF) +ENDIF() + IF (WIN32 AND WITH_DAEMON) MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.") SET(WITH_DAEMON OFF) diff --git a/src/openalpr/CMakeLists.txt b/src/openalpr/CMakeLists.txt index bfb3b22..6ec14b9 100644 --- a/src/openalpr/CMakeLists.txt +++ b/src/openalpr/CMakeLists.txt @@ -61,7 +61,9 @@ install (TARGETS openalpr-static DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) install (TARGETS openalpr DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) # Compile GPU detector -#add_definitions(-DCOMPILE_GPU=1) +IF ( WITH_GPU_DETECTOR ) +add_definitions(-DCOMPILE_GPU=1) +ENDIF() # Add definition for default config file add_definitions(-DDEFAULT_CONFIG_FILE="${CMAKE_INSTALL_SYSCONFDIR}/openalpr/openalpr.conf") From 0f2112dfee0cc75b3e65bf8551873f3cb234aea6 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 15:02:44 +0200 Subject: [PATCH 3/8] Building tests should be optional. --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 48e803e..9fdab0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,10 @@ if ( NOT DEFINED WITH_GPU_DETECTOR ) SET(WITH_GPU_DETECTOR OFF) ENDIF() +if ( NOT DEFINED WITH_TESTS ) + SET(WITH_TESTS ON) +ENDIF() + IF (WIN32 AND WITH_DAEMON) MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.") SET(WITH_DAEMON OFF) @@ -104,8 +108,10 @@ IF (WITH_DAEMON) # Don't include misc utilities for Windows add_subdirectory(misc_utilities) ENDIF() - + +if (WITH_TESTS) add_subdirectory(tests) +ENDIF() add_subdirectory(openalpr) add_subdirectory(video) From 0def9ee1c8169c535fb098993edc1bfbb3e473d2 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 15:03:10 +0200 Subject: [PATCH 4/8] Building java/python binding should be optional. --- src/CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fdab0e..e717456 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,6 +35,14 @@ if ( NOT DEFINED WITH_TESTS ) SET(WITH_TESTS ON) ENDIF() +if ( NOT DEFINED WITH_BINDING_JAVA ) + SET(WITH_BINDING_JAVA ON) +ENDIF() + +if ( NOT DEFINED WITH_BINDING_PYTHON ) + SET(WITH_BINDING_PYTHON ON) +ENDIF() + IF (WIN32 AND WITH_DAEMON) MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.") SET(WITH_DAEMON OFF) @@ -116,8 +124,13 @@ ENDIF() add_subdirectory(openalpr) add_subdirectory(video) -add_subdirectory(bindings/python) +if (WITH_BINDING_JAVA) add_subdirectory(bindings/java) +ENDIF() + +if (WITH_BINDING_PYTHON) +add_subdirectory(bindings/python) +ENDIF() 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) From 9e76a80138a2b110c03afb9b95a857e4a65d55ab Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 15:09:24 +0200 Subject: [PATCH 5/8] Allow alpr executable to be statically linked. Default: OFF --- src/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e717456..7689b60 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,6 +43,10 @@ if ( NOT DEFINED WITH_BINDING_PYTHON ) SET(WITH_BINDING_PYTHON ON) ENDIF() +if ( NOT DEFINED WITH_ALPR_STATICALLY_LINKED) + SET(WITH_ALPR_STATICALLY_LINKED OFF) +ENDIF() + IF (WIN32 AND WITH_DAEMON) MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.") SET(WITH_DAEMON OFF) @@ -89,8 +93,14 @@ ENDIF() set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ") ADD_EXECUTABLE( alpr main.cpp ) +if (WITH_ALPR_STATICALLY_LINKED) + SET(ALPR_LINK_LIBRARY openalpr-static) +ELSE() + SET(ALPR_LINK_LIBRARY openalpr) +ENDIF() + TARGET_LINK_LIBRARIES(alpr - openalpr + ${ALPR_LINK_LIBRARY} support video ${OpenCV_LIBS} From 672d2172f9d4486f64679adcda1984ae922d5cae Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 21:21:55 +0200 Subject: [PATCH 6/8] Set assembly version for .NET binding. See https://github.com/peters/openalpr-windows/commit/3c7271757841bae373dfa5ac5ee3e724c6a4ba19 --- src/bindings/csharp/openalpr-net/AssemblyInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bindings/csharp/openalpr-net/AssemblyInfo.cpp b/src/bindings/csharp/openalpr-net/AssemblyInfo.cpp index 61560b3..f600e22 100644 --- a/src/bindings/csharp/openalpr-net/AssemblyInfo.cpp +++ b/src/bindings/csharp/openalpr-net/AssemblyInfo.cpp @@ -31,7 +31,9 @@ using namespace System::Security::Permissions; // You can specify all the value or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly:AssemblyVersionAttribute("1.0.*")]; +[assembly: AssemblyVersionAttribute("2.0.1")] +[assembly: AssemblyFileVersionAttribute("2.0.1")] +[assembly: AssemblyInformationalVersionAttribute("2.0.1")] [assembly:ComVisible(false)]; From bac1ce2c5a6a1b2f48d6186abb501ffee361fd96 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 21:58:17 +0200 Subject: [PATCH 7/8] Enable building utilities on windows. --- src/CMakeLists.txt | 18 ++++++++++++------ src/misc_utilities/CMakeLists.txt | 12 ++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7689b60..9dd1b13 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,10 @@ if ( NOT DEFINED WITH_ALPR_STATICALLY_LINKED) SET(WITH_ALPR_STATICALLY_LINKED OFF) ENDIF() +if ( NOT DEFINED WITH_UTILITIES ) + SET(WITH_UTILITIES ON) +ENDIF() + IF (WIN32 AND WITH_DAEMON) MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.") SET(WITH_DAEMON OFF) @@ -93,14 +97,14 @@ ENDIF() set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ") ADD_EXECUTABLE( alpr main.cpp ) -if (WITH_ALPR_STATICALLY_LINKED) - SET(ALPR_LINK_LIBRARY openalpr-static) +if (WIN32) + SET(OPENALPR_LIB openalpr-static) ELSE() - SET(ALPR_LINK_LIBRARY openalpr) + SET(OPENALPR_LIB openalpr) ENDIF() TARGET_LINK_LIBRARIES(alpr - ${ALPR_LINK_LIBRARY} + ${OPENALPR_LIB} support video ${OpenCV_LIBS} @@ -123,8 +127,10 @@ IF (WITH_DAEMON) ${Extra_LIBS} ) - # Don't include misc utilities for Windows - add_subdirectory(misc_utilities) +ENDIF() + +if(WITH_UTILITIES) +add_subdirectory(misc_utilities) ENDIF() if (WITH_TESTS) diff --git a/src/misc_utilities/CMakeLists.txt b/src/misc_utilities/CMakeLists.txt index 9d48572..0251c40 100644 --- a/src/misc_utilities/CMakeLists.txt +++ b/src/misc_utilities/CMakeLists.txt @@ -1,7 +1,7 @@ ADD_EXECUTABLE( openalpr-utils-sortstate sortstate.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-sortstate - openalpr + ${OPENALPR_LIB} support ${OpenCV_LIBS} ${Tesseract_LIBRARIES} @@ -9,7 +9,7 @@ TARGET_LINK_LIBRARIES(openalpr-utils-sortstate ADD_EXECUTABLE( openalpr-utils-classifychars classifychars.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-classifychars - openalpr + ${OPENALPR_LIB} support ${OpenCV_LIBS} ${Tesseract_LIBRARIES} @@ -22,7 +22,7 @@ ADD_EXECUTABLE(openalpr-utils-benchmark benchmarks/endtoendtest.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-benchmark - openalpr + ${OPENALPR_LIB} support pthread ${OpenCV_LIBS} @@ -38,21 +38,21 @@ TARGET_LINK_LIBRARIES(openalpr-utils-prepcharsfortraining ADD_EXECUTABLE( openalpr-utils-binarizefontsheet binarizefontsheet.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-binarizefontsheet - openalpr + ${OPENALPR_LIB} support ${OpenCV_LIBS} ) ADD_EXECUTABLE( openalpr-utils-tagplates tagplates.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-tagplates - openalpr + ${OPENALPR_LIB} support ${OpenCV_LIBS} ) ADD_EXECUTABLE( openalpr-utils-calibrate calibrate.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-calibrate - openalpr + ${OPENALPR_LIB} support ${OpenCV_LIBS} ${Tesseract_LIBRARIES} From 254462089faac8da8347b22f9bcec08437146245 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Mon, 6 Jul 2015 22:13:07 +0200 Subject: [PATCH 8/8] Don't compile benchmark on Windows, it's not portable (yet). --- src/misc_utilities/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/misc_utilities/CMakeLists.txt b/src/misc_utilities/CMakeLists.txt index 0251c40..969cb9d 100644 --- a/src/misc_utilities/CMakeLists.txt +++ b/src/misc_utilities/CMakeLists.txt @@ -15,7 +15,7 @@ TARGET_LINK_LIBRARIES(openalpr-utils-classifychars ${Tesseract_LIBRARIES} ) - +if (NOT DEFINED WIN32) ADD_EXECUTABLE(openalpr-utils-benchmark benchmarks/benchmark.cpp benchmarks/benchmark_utils.cpp @@ -28,7 +28,7 @@ TARGET_LINK_LIBRARIES(openalpr-utils-benchmark ${OpenCV_LIBS} ${Tesseract_LIBRARIES} ) - +ENDIF() ADD_EXECUTABLE( openalpr-utils-prepcharsfortraining prepcharsfortraining.cpp ) TARGET_LINK_LIBRARIES(openalpr-utils-prepcharsfortraining @@ -64,7 +64,11 @@ install (TARGETS openalpr-utils-calibrate DESTINATION bin) install (TARGETS openalpr-utils-sortstate DESTINATION bin) install (TARGETS openalpr-utils-classifychars DESTINATION bin) + +if (NOT DEFINED WIN32) install (TARGETS openalpr-utils-benchmark DESTINATION bin) +ENDIF() + install (TARGETS openalpr-utils-prepcharsfortraining DESTINATION bin) install (TARGETS openalpr-utils-tagplates DESTINATION bin) install (TARGETS openalpr-utils-calibrate DESTINATION bin)