Skip to content

Commit f9f8cae

Browse files
committed
cmake: fix FindJava/FindJNI wrappers for cmake re-runs
when cmake is re-run and include(FindJAVA) is skipped, JAVA_FOUND should still be set. Same for JNI.
1 parent 6bf866c commit f9f8cae

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cmake/FindJNI.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
if(JAVA_AWT_LIBRARY)
2+
set(JNI_FOUND TRUE)
3+
return()
4+
endif()
15
if(DEFINED JAVA_AWT_LIBRARY)
6+
set(JNI_FOUND FALSE)
27
return()
38
endif()
49

cmake/FindJava.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
if(Java_JAVA_EXECUTABLE)
2+
set(JAVA_FOUND TRUE)
3+
return()
4+
endif()
15
if(DEFINED Java_JAVA_EXECUTABLE)
6+
set(JAVA_FOUND FALSE)
27
return()
38
endif()
49

0 commit comments

Comments
 (0)