UseJava: Teach install_jar new DESTINATION and COMPONENT options
This commit is contained in:
parent
3d287de4ea
commit
cc23f0e9d3
@ -7,3 +7,7 @@ java-updates
|
|||||||
* The :module:`UseJava` module ``add_jar`` function learned
|
* The :module:`UseJava` module ``add_jar`` function learned
|
||||||
to support response files (e.g. ``@srcs.txt``) for source
|
to support response files (e.g. ``@srcs.txt``) for source
|
||||||
specification.
|
specification.
|
||||||
|
|
||||||
|
* The :module:`UseJava` module ``install_jar`` function learned
|
||||||
|
new ``DESTINATION`` and ``COMPONENT`` options to specify
|
||||||
|
the corresponding :command:`install` command options.
|
||||||
|
@ -211,14 +211,16 @@
|
|||||||
#
|
#
|
||||||
# ::
|
# ::
|
||||||
#
|
#
|
||||||
# install_jar(TARGET_NAME DESTINATION)
|
# install_jar(target_name destination)
|
||||||
|
# install_jar(target_name DESTINATION destination [COMPONENT component])
|
||||||
#
|
#
|
||||||
# This command installs the TARGET_NAME files to the given DESTINATION.
|
# This command installs the TARGET_NAME files to the given DESTINATION.
|
||||||
# It should be called in the same scope as add_jar() or it will fail.
|
# It should be called in the same scope as add_jar() or it will fail.
|
||||||
#
|
#
|
||||||
# ::
|
# ::
|
||||||
#
|
#
|
||||||
# install_jni_symlink(TARGET_NAME DESTINATION)
|
# install_jni_symlink(target_name destination)
|
||||||
|
# install_jni_symlink(target_name DESTINATION destination [COMPONENT component])
|
||||||
#
|
#
|
||||||
# This command installs the TARGET_NAME JNI symlinks to the given
|
# This command installs the TARGET_NAME JNI symlinks to the given
|
||||||
# DESTINATION. It should be called in the same scope as add_jar() or it
|
# DESTINATION. It should be called in the same scope as add_jar() or it
|
||||||
@ -629,7 +631,26 @@ function(add_jar _TARGET_NAME)
|
|||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(INSTALL_JAR _TARGET_NAME _DESTINATION)
|
function(INSTALL_JAR _TARGET_NAME)
|
||||||
|
if (ARGC EQUAL 2)
|
||||||
|
set (_DESTINATION ${ARGV1})
|
||||||
|
else()
|
||||||
|
cmake_parse_arguments(_install_jar
|
||||||
|
""
|
||||||
|
"DESTINATION;COMPONENT"
|
||||||
|
""
|
||||||
|
${ARGN})
|
||||||
|
if (_install_jar_DESTINATION)
|
||||||
|
set (_DESTINATION ${_install_jar_DESTINATION})
|
||||||
|
else()
|
||||||
|
message(SEND_ERROR "install_jar: ${_TARGET_NAME}: DESTINATION must be specified.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (_install_jar_COMPONENT)
|
||||||
|
set (_COMPONENT COMPONENT ${_install_jar_COMPONENT})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
get_property(__FILES
|
get_property(__FILES
|
||||||
TARGET
|
TARGET
|
||||||
${_TARGET_NAME}
|
${_TARGET_NAME}
|
||||||
@ -643,13 +664,33 @@ function(INSTALL_JAR _TARGET_NAME _DESTINATION)
|
|||||||
${__FILES}
|
${__FILES}
|
||||||
DESTINATION
|
DESTINATION
|
||||||
${_DESTINATION}
|
${_DESTINATION}
|
||||||
|
${_COMPONENT}
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
|
message(SEND_ERROR "install_jar: The target ${_TARGET_NAME} is not known in this scope.")
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
|
function(INSTALL_JNI_SYMLINK _TARGET_NAME)
|
||||||
|
if (ARGC EQUAL 2)
|
||||||
|
set (_DESTINATION ${ARGV1})
|
||||||
|
else()
|
||||||
|
cmake_parse_arguments(_install_jni_symlink
|
||||||
|
""
|
||||||
|
"DESTINATION;COMPONENT"
|
||||||
|
""
|
||||||
|
${ARGN})
|
||||||
|
if (_install_jni_symlink_DESTINATION)
|
||||||
|
set (_DESTINATION ${_install_jni_symlink_DESTINATION})
|
||||||
|
else()
|
||||||
|
message(SEND_ERROR "install_jni_symlink: ${_TARGET_NAME}: DESTINATION must be specified.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (_install_jni_symlink_COMPONENT)
|
||||||
|
set (_COMPONENT COMPONENT ${_install_jni_symlink_COMPONENT})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
get_property(__SYMLINK
|
get_property(__SYMLINK
|
||||||
TARGET
|
TARGET
|
||||||
${_TARGET_NAME}
|
${_TARGET_NAME}
|
||||||
@ -663,9 +704,10 @@ function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
|
|||||||
${__SYMLINK}
|
${__SYMLINK}
|
||||||
DESTINATION
|
DESTINATION
|
||||||
${_DESTINATION}
|
${_DESTINATION}
|
||||||
|
${_COMPONENT}
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
|
message(SEND_ERROR "install_jni_symlink: The target ${_TARGET_NAME} is not known in this scope.")
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user