Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't try to use git with windows and cmake
[simgrid.git] / FindJavaSG.cmake
1 include(FindJava)
2 include(FindJNI)
3         
4 message(STATUS "Looking for jni.h")
5 if(JAVA_INCLUDE_PATH)
6  message(STATUS "Looking for jni.h - found")
7 else(JAVA_INCLUDE_PATH)
8  message(STATUS "Looking for jni.h - not found")
9 endif(JAVA_INCLUDE_PATH)
10 if(JAVA_INCLUDE_PATH)
11         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH} ")
12         message(STATUS "Add flags -I${JAVA_INCLUDE_PATH}")
13 else(JAVA_INCLUDE_PATH)
14         message(STATUS "Need to set JAVA_INCLUDE_PATH to jni.h")
15 endif(JAVA_INCLUDE_PATH)
16
17 message(STATUS "Looking for jni_md.h")
18 if(JAVA_INCLUDE_PATH2)
19 message(STATUS "Looking for jni_md.h - found")
20 else(JAVA_INCLUDE_PATH2)
21 message(STATUS "Looking for jni_md.h - not found")
22 endif(JAVA_INCLUDE_PATH2)
23 if(JAVA_INCLUDE_PATH2)
24 if(NOT JAVA_INCLUDE_PATH STREQUAL JAVA_INCLUDE_PATH2)
25         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH2} ")
26         message(STATUS "Add flags -I${JAVA_INCLUDE_PATH2}")
27 endif(NOT JAVA_INCLUDE_PATH STREQUAL JAVA_INCLUDE_PATH2)
28 endif(JAVA_INCLUDE_PATH2)
29
30 if(JAVA_COMPILE)
31 message(STATUS "Found javac: ${JAVA_COMPILE}")
32 else(JAVA_COMPILE)
33 message(FATAL_ERROR "Not found javac bin")
34 endif(JAVA_COMPILE)
35
36 if(JAVA_ARCHIVE)
37 message(STATUS "Found jar: ${JAVA_ARCHIVE}")
38 else(JAVA_ARCHIVE)
39 message(FATAL_ERROR "Not found jar bin")
40 endif(JAVA_ARCHIVE)