mirror of
https://github.com/reactos/CMake.git
synced 2024-12-02 00:26:18 +00:00
UseJava.cmake: simplify path logic
Move logic to determine relative path to .java file to after the file extension check, so that it only executes when it is actually used.
This commit is contained in:
parent
a95968fec9
commit
45c8e4b181
@ -264,6 +264,7 @@ function(add_jar _TARGET_NAME)
|
||||
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
|
||||
get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE)
|
||||
|
||||
if (_JAVA_EXT MATCHES ".java")
|
||||
file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL})
|
||||
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
|
||||
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
|
||||
@ -275,7 +276,6 @@ function(add_jar _TARGET_NAME)
|
||||
endif ()
|
||||
get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
|
||||
|
||||
if (_JAVA_EXT MATCHES ".java")
|
||||
list(APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE})
|
||||
set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class")
|
||||
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE})
|
||||
|
Loading…
Reference in New Issue
Block a user