diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-09-22 18:42:05 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-09-22 18:42:05 (GMT) |
commit | 692ba48c4e5762b370f2999e902b8bd677c77161 (patch) | |
tree | 0c9465d0e38a15bd0cb043f234b4e4ab0cee51a2 /Modules/CMakeDetermineJavaCompiler.cmake | |
parent | 597185754420db18d83b2c9e3b9f1e33675bd935 (diff) | |
download | CMake-692ba48c4e5762b370f2999e902b8bd677c77161.zip CMake-692ba48c4e5762b370f2999e902b8bd677c77161.tar.gz CMake-692ba48c4e5762b370f2999e902b8bd677c77161.tar.bz2 |
ENH: major changes to support addition of languages from cmake modules directory.
Diffstat (limited to 'Modules/CMakeDetermineJavaCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineJavaCompiler.cmake | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake index de5227d..03e7719 100644 --- a/Modules/CMakeDetermineJavaCompiler.cmake +++ b/Modules/CMakeDetermineJavaCompiler.cmake @@ -1,34 +1,40 @@ # determine the compiler to use for Java programs -# NOTE, a generator may set CMAKE_JAVA_COMPILER before +# NOTE, a generator may set CMAKE_Java_COMPILER before # loading this file to force a compiler. -IF(NOT CMAKE_JAVA_COMPILER) +IF(NOT CMAKE_Java_COMPILER) # prefer the environment variable CC IF($ENV{JAVA_COMPILER} MATCHES ".+") - GET_FILENAME_COMPONENT(CMAKE_JAVA_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_JAVA_FLAGS_ENV_INIT) - IF(EXISTS ${CMAKE_JAVA_COMPILER_INIT}) - ELSE(EXISTS ${CMAKE_JAVA_COMPILER_INIT}) + GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) + IF(EXISTS ${CMAKE_Java_COMPILER_INIT}) + ELSE(EXISTS ${CMAKE_Java_COMPILER_INIT}) MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.") - ENDIF(EXISTS ${CMAKE_JAVA_COMPILER_INIT}) + ENDIF(EXISTS ${CMAKE_Java_COMPILER_INIT}) ENDIF($ENV{JAVA_COMPILER} MATCHES ".+") IF($ENV{JAVA_RUNTIME} MATCHES ".+") - GET_FILENAME_COMPONENT(CMAKE_JAVA_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_JAVA_FLAGS_ENV_INIT) - IF(EXISTS ${CMAKE_JAVA_RUNTIME_INIT}) - ELSE(EXISTS ${CMAKE_JAVA_RUNTIME_INIT}) + GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) + IF(EXISTS ${CMAKE_Java_RUNTIME_INIT}) + ELSE(EXISTS ${CMAKE_Java_RUNTIME_INIT}) MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.") - ENDIF(EXISTS ${CMAKE_JAVA_RUNTIME_INIT}) + ENDIF(EXISTS ${CMAKE_Java_RUNTIME_INIT}) ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+") IF($ENV{JAVA_ARCHIVE} MATCHES ".+") - GET_FILENAME_COMPONENT(CMAKE_JAVA_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_JAVA_FLAGS_ENV_INIT) - IF(EXISTS ${CMAKE_JAVA_ARCHIVE_INIT}) - ELSE(EXISTS ${CMAKE_JAVA_ARCHIVE_INIT}) + GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) + IF(EXISTS ${CMAKE_Java_ARCHIVE_INIT}) + ELSE(EXISTS ${CMAKE_Java_ARCHIVE_INIT}) MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.") - ENDIF(EXISTS ${CMAKE_JAVA_ARCHIVE_INIT}) + ENDIF(EXISTS ${CMAKE_Java_ARCHIVE_INIT}) ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+") - SET(JAVA_BIN_PATH + SET(Java_BIN_PATH + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin" /usr/bin @@ -36,41 +42,42 @@ IF(NOT CMAKE_JAVA_COMPILER) /usr/share/java/bin /usr/local/bin /usr/local/java/bin + /usr/java/j2sdk1.4.2_04 ) # if no compiler has been specified yet, then look for one - IF(CMAKE_JAVA_COMPILER_INIT) - SET(CMAKE_JAVA_COMPILER ${CMAKE_JAVA_COMPILER_INIT} CACHE PATH "Java Compiler") - ELSE(CMAKE_JAVA_COMPILER_INIT) - FIND_PROGRAM(CMAKE_JAVA_COMPILER + IF(CMAKE_Java_COMPILER_INIT) + SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler") + ELSE(CMAKE_Java_COMPILER_INIT) + FIND_PROGRAM(CMAKE_Java_COMPILER NAMES javac - PATHS ${JAVA_BIN_PATH} + PATHS ${Java_BIN_PATH} ) - ENDIF(CMAKE_JAVA_COMPILER_INIT) + ENDIF(CMAKE_Java_COMPILER_INIT) # if no runtime has been specified yet, then look for one - IF(CMAKE_JAVA_RUNTIME_INIT) - SET(CMAKE_JAVA_RUNTIME ${CMAKE_JAVA_RUNTIME_INIT} CACHE PATH "Java Compiler") - ELSE(CMAKE_JAVA_RUNTIME_INIT) - FIND_PROGRAM(CMAKE_JAVA_RUNTIME + IF(CMAKE_Java_RUNTIME_INIT) + SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler") + ELSE(CMAKE_Java_RUNTIME_INIT) + FIND_PROGRAM(CMAKE_Java_RUNTIME NAMES java - PATHS ${JAVA_BIN_PATH} + PATHS ${Java_BIN_PATH} ) - ENDIF(CMAKE_JAVA_RUNTIME_INIT) + ENDIF(CMAKE_Java_RUNTIME_INIT) # if no archive has been specified yet, then look for one - IF(CMAKE_JAVA_ARCHIVE_INIT) - SET(CMAKE_JAVA_ARCHIVE ${CMAKE_JAVA_ARCHIVE_INIT} CACHE PATH "Java Compiler") - ELSE(CMAKE_JAVA_ARCHIVE_INIT) - FIND_PROGRAM(CMAKE_JAVA_ARCHIVE + IF(CMAKE_Java_ARCHIVE_INIT) + SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler") + ELSE(CMAKE_Java_ARCHIVE_INIT) + FIND_PROGRAM(CMAKE_Java_ARCHIVE NAMES jar - PATHS ${JAVA_BIN_PATH} + PATHS ${Java_BIN_PATH} ) - ENDIF(CMAKE_JAVA_ARCHIVE_INIT) -ENDIF(NOT CMAKE_JAVA_COMPILER) -MARK_AS_ADVANCED(CMAKE_JAVA_COMPILER) + ENDIF(CMAKE_Java_ARCHIVE_INIT) +ENDIF(NOT CMAKE_Java_COMPILER) +MARK_AS_ADVANCED(CMAKE_Java_COMPILER) # configure variables set in this file for fast reload later on CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in ${CMAKE_BINARY_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY) -MARK_AS_ADVANCED(CMAKE_AR CMAKE_JAVA_COMPILER_FULLPATH) -SET(CMAKE_JAVA_COMPILER_ENV_VAR "JC") +MARK_AS_ADVANCED(CMAKE_AR CMAKE_Java_COMPILER_FULLPATH) +SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER") |