Enable Java test more carefully on Apple
The CTEST_RUN_Java option added by commit c8f39193
(Avoid problem
reading jni.h on Macs, 2010-10-25) was a quick hack to disable the Java
test on Mac machines after an update from Apple created a broken jni.h
symlink. Remove the option and instead test whether jni.h exists as a
readable file before reading it. This restores the original Java test
enabling logic but makes it robust to the broken symlink.
This commit is contained in:
parent
ac9f50e091
commit
46c0a5832d
|
@ -1868,22 +1868,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
if(NOT DEFINED CTEST_RUN_Java)
|
|
||||||
if(APPLE)
|
|
||||||
set(CTEST_RUN_Java OFF)
|
|
||||||
else()
|
|
||||||
set(CTEST_RUN_Java ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
IF(CTEST_RUN_Java)
|
|
||||||
find_package(Java QUIET)
|
find_package(Java QUIET)
|
||||||
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
|
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
|
||||||
GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
|
GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
|
||||||
FIND_FILE(JNI_H jni.h
|
FIND_FILE(JNI_H jni.h
|
||||||
"${JNIPATH}/../include"
|
"${JNIPATH}/../include"
|
||||||
"${JNIPATH}/../java/include")
|
"${JNIPATH}/../java/include")
|
||||||
IF(JNI_H)
|
IF(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
|
||||||
FILE(READ "${JNI_H}" JNI_FILE)
|
FILE(READ "${JNI_H}" JNI_FILE)
|
||||||
IF("${JNI_FILE}" MATCHES "JDK1_2")
|
IF("${JNI_FILE}" MATCHES "JDK1_2")
|
||||||
ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
|
ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
|
||||||
|
@ -1898,9 +1889,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
|
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
|
||||||
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
|
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
|
||||||
ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
|
ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
|
||||||
ENDIF(JNI_H)
|
ENDIF()
|
||||||
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
|
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
|
||||||
ENDIF(CTEST_RUN_Java)
|
|
||||||
|
|
||||||
# add some cross compiler tests, for now only with makefile based generators
|
# add some cross compiler tests, for now only with makefile based generators
|
||||||
IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
|
IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
|
||||||
|
|
Loading…
Reference in New Issue