FindJNI: Append path only "if(EXISTS"

This commit is contained in:
O. Libre 2016-03-08 06:06:20 +01:00 committed by Brad King
parent add2557865
commit 1b029ea91f
1 changed files with 6 additions and 2 deletions

View File

@ -92,10 +92,14 @@ macro(java_append_library_directories _var)
if(_path MATCHES "{libarch}")
foreach(_libarch ${_java_libarch})
string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
list(APPEND ${_var} "${_newpath}")
if(EXISTS ${_newpath})
list(APPEND ${_var} "${_newpath}")
endif()
endforeach()
else()
list(APPEND ${_var} "${_path}")
if(EXISTS ${_path})
list(APPEND ${_var} "${_path}")
endif()
endif()
endforeach()
endmacro()