diff options
Diffstat (limited to 'Tests/Java')
-rw-r--r-- | Tests/Java/CMakeLists.txt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Tests/Java/CMakeLists.txt b/Tests/Java/CMakeLists.txt index 2bff10d..dfcc596 100644 --- a/Tests/Java/CMakeLists.txt +++ b/Tests/Java/CMakeLists.txt @@ -1,19 +1,22 @@ PROJECT(hello Java) SET(CMAKE_VERBOSE_MAKEFILE 1) -SET(OLD_CUSTOM_COMMAND_WAY ) -message("${hello_SOURCE_DIR} STREQUAL ${hello_BINARY_DIR}") IF("${hello_SOURCE_DIR}" STREQUAL "${hello_BINARY_DIR}") + MESSAGE("In Source, building Java using ADD_CUSTOM_COMMAND()") SET(OLD_CUSTOM_COMMAND_WAY 1) +ELSE("${hello_SOURCE_DIR}" STREQUAL "${hello_BINARY_DIR}") + MESSAGE("Out of source, using built-in Java support") + SET(OLD_CUSTOM_COMMAND_WAY ) ENDIF("${hello_SOURCE_DIR}" STREQUAL "${hello_BINARY_DIR}") + IF(NOT OLD_CUSTOM_COMMAND_WAY) + INCLUDE_DIRECTORIES(${hello_SOURCE_DIR} ${hello_BINARY_DIR} ) ADD_LIBRARY(hello A.java HelloWorld.java) -ENDIF(NOT OLD_CUSTOM_COMMAND_WAY) +ELSE(NOT OLD_CUSTOM_COMMAND_WAY) -IF(OLD_CUSTOM_COMMAND_WAY) ADD_CUSTOM_COMMAND( OUTPUT ${hello_BINARY_DIR}/A.class MAIN_DEPENDENCY ${hello_SOURCE_DIR}/A.java @@ -33,4 +36,6 @@ IF(OLD_CUSTOM_COMMAND_WAY) ADD_CUSTOM_TARGET(hello.jar ALL DEPENDS ${hello_BINARY_DIR}/hello.jar) -ENDIF(OLD_CUSTOM_COMMAND_WAY) + +ENDIF(NOT OLD_CUSTOM_COMMAND_WAY) + |