ENH: add some java code to try and find the system path

This commit is contained in:
Bill Hoffman 2004-09-24 15:40:40 -04:00
parent e63ea0a6d2
commit 0a26f8d46c
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,8 @@
class CMakeCheckJavaPath
{
public static void main(String args[])
{
System.out.println(System.getProperty("sun.boot.class.path", "(none)"));
}
}

View File

@ -2,6 +2,14 @@ PROJECT(hello Java)
SET(CMAKE_VERBOSE_MAKEFILE 1)
SET(OLD_CUSTOM_COMMAND_WAY )
IF(NOT OLD_CUSTOM_COMMAND_WAY)
CONFIGURE_FILE(${hello_SOURCE_DIR}/CMakeCheckJavaPath.java
${hello_BINARY_DIR}/CMakeCheckJavaPath.java IMMEDIATE)
EXEC_PROGRAM(${CMAKE_Java_COMPILER} ${hello_BINARY_DIR}
ARGS CMakeCheckJavaPath.java)
EXEC_PROGRAM(${CMAKE_Java_RUNTIME} ${hello_BINARY_DIR}
ARGS CMakeCheckJavaPath OUTPUT_VARIABLE OUT)
INCLUDE_DIRECTORIES(${hello_SOURCE_DIR} ${OUT}
${hello_BINARY_DIR} )
ADD_LIBRARY(hello A.java HelloWorld.java)
ENDIF(NOT OLD_CUSTOM_COMMAND_WAY)