Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add Process.getProperty, Host.getProperty, Host.setProperty (update Changelog)
[simgrid.git] / FindJavaSG.cmake
index 4de80c5..92d254d 100644 (file)
@@ -1,30 +1,40 @@
 include(FindJava)
 include(FindJNI)
        
-if(JAVA_COMPILE AND JAVA_INCLUDE_PATH)
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH} ")
-else(JAVA_COMPILE AND JAVA_INCLUDE_PATH) 
-       message(FATAL_ERROR "Can't compile java!!!")
-endif(JAVA_COMPILE AND JAVA_INCLUDE_PATH)
-
 message(STATUS "Looking for jni.h")
 if(JAVA_INCLUDE_PATH)
-message(STATUS "Looking for jni.h - found")
+ message(STATUS "Looking for jni.h - found")
 else(JAVA_INCLUDE_PATH)
-message(STATUS "Looking for ljni.h - not found")
+ message(STATUS "Looking for jni.h - not found")
+endif(JAVA_INCLUDE_PATH)
+if(JAVA_INCLUDE_PATH)
+       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH} ")
+       message(STATUS "Add flags -I${JAVA_INCLUDE_PATH}")
+else(JAVA_INCLUDE_PATH)
+       message(STATUS "Need to set JAVA_INCLUDE_PATH to jni.h")
 endif(JAVA_INCLUDE_PATH)
 
 message(STATUS "Looking for jni_md.h")
 if(JAVA_INCLUDE_PATH2)
 message(STATUS "Looking for jni_md.h - found")
 else(JAVA_INCLUDE_PATH2)
-message(STATUS "Looking for jni_md.h - found")
+message(STATUS "Looking for jni_md.h - not found")
+endif(JAVA_INCLUDE_PATH2)
+if(JAVA_INCLUDE_PATH2)
+if(NOT JAVA_INCLUDE_PATH STREQUAL JAVA_INCLUDE_PATH2)
+       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH2} ")
+       message(STATUS "Add flags -I${JAVA_INCLUDE_PATH2}")
+endif(NOT JAVA_INCLUDE_PATH STREQUAL JAVA_INCLUDE_PATH2)
 endif(JAVA_INCLUDE_PATH2)
 
 if(JAVA_COMPILE)
 message(STATUS "Found javac: ${JAVA_COMPILE}")
+else(JAVA_COMPILE)
+message(FATAL_ERROR "Not found javac bin")
 endif(JAVA_COMPILE)
 
 if(JAVA_ARCHIVE)
 message(STATUS "Found jar: ${JAVA_ARCHIVE}")
+else(JAVA_ARCHIVE)
+message(FATAL_ERROR "Not found jar bin")
 endif(JAVA_ARCHIVE)
\ No newline at end of file