Skip to content

Commit

Permalink
cmake: fix FindJava/FindJNI wrappers for cmake re-runs
Browse files Browse the repository at this point in the history
when cmake is re-run and include(FindJAVA) is skipped,
JAVA_FOUND should still be set. Same for JNI.
  • Loading branch information
vuvova committed May 22, 2021
1 parent 6bf866c commit f9f8cae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/FindJNI.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
if(JAVA_AWT_LIBRARY)
set(JNI_FOUND TRUE)
return()
endif()
if(DEFINED JAVA_AWT_LIBRARY)
set(JNI_FOUND FALSE)
return()
endif()

Expand Down
5 changes: 5 additions & 0 deletions cmake/FindJava.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
if(Java_JAVA_EXECUTABLE)
set(JAVA_FOUND TRUE)
return()
endif()
if(DEFINED Java_JAVA_EXECUTABLE)
set(JAVA_FOUND FALSE)
return()
endif()

Expand Down

0 comments on commit f9f8cae

Please sign in to comment.