Permalink
Browse files

Use the correct JAVA_FOUND variable

  • Loading branch information...
1 parent 6cbb9cc commit 342ffe704697b2f3fe2c40fd9631cf6951cbeb0b @Kazade committed Jan 4, 2013
Showing with 10 additions and 3 deletions.
  1. +10 −3 java/CMakeLists.txt
View
@@ -1,8 +1,12 @@
FIND_PACKAGE(Java) #Find the java executables
-IF(Java_FOUND)
-FIND_PACKAGE(JNI REQUIRED)
+IF(JAVA_FOUND)
+
+FIND_PACKAGE(JNI)
+
+IF(JNI_FOUND)
+MESSAGE("Building JNI wrapper")
SET(JKAZMATH_CLASS kazmath/jkazmath.class)
SET(JKAZMATH_HEADER jni/kazmath_jkazmath.h)
@@ -24,5 +28,8 @@ ADD_CUSTOM_COMMAND(TARGET Jkazmath POST_BUILD COMMAND ${Java_JAR_EXECUTABLE} cvf
INSTALL(TARGETS Jkazmath LIBRARY DESTINATION lib)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kazmath.jar DESTINATION ${CMAKE_INSTALL_PREFIX}/share/java)
+ELSE(JNI_FOUND)
+MESSAGE("Not building JNI wrapper. Couldn't find JNI")
+ENDIF(JNI_FOUND)
-ENDIF(Java_FOUND)
+ENDIF(JAVA_FOUND)

0 comments on commit 342ffe7

Please sign in to comment.