mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 22:32:43 +08:00
Skip JNI library compile if Java not found
This commit is contained in:
@@ -4,22 +4,26 @@ cmake_minimum_required (VERSION 2.6)
|
|||||||
|
|
||||||
find_package(JNI REQUIRED)
|
find_package(JNI REQUIRED)
|
||||||
|
|
||||||
|
if (${JNI_FOUND} MATCHES "TRUE")
|
||||||
include_directories(
|
include_directories(
|
||||||
../../openalpr/
|
../../openalpr/
|
||||||
${JAVA_INCLUDE_PATH}
|
${JAVA_INCLUDE_PATH}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
set(jni_source_files
|
set(jni_source_files
|
||||||
openalprjni.cpp
|
openalprjni.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
add_library(openalprjni SHARED ${jni_source_files})
|
|
||||||
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(openalprjni openalpr)
|
add_library(openalprjni SHARED ${jni_source_files})
|
||||||
|
|
||||||
|
|
||||||
install (TARGETS openalprjni DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
TARGET_LINK_LIBRARIES(openalprjni openalpr)
|
||||||
|
|
||||||
|
|
||||||
|
install (TARGETS openalprjni DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||||
|
else()
|
||||||
|
MESSAGE("JAVA JNI library not found, skipping openalprjni compilation")
|
||||||
|
|
||||||
|
endif()
|
Reference in New Issue
Block a user