[build] CMake: simplify source JAR creation and install (#6831)

Bump required minimum CMake version to 3.21.
This commit is contained in:
Gold856
2024-07-15 18:12:41 -04:00
committed by GitHub
parent fc57f6a560
commit 9703142ebe
15 changed files with 131 additions and 204 deletions

View File

@@ -18,3 +18,16 @@ if(WITH_JAVA)
install_jar_exports(TARGETS wpiunits_jar FILE wpiunits.cmake DESTINATION share/wpiunits)
install(FILES wpiunits-config.cmake DESTINATION share/wpiunits)
endif()
if(WITH_JAVA_SOURCE)
include(UseJava)
include(CreateSourceJar)
add_source_jar(
wpiunits_src_jar
BASE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java
OUTPUT_NAME wpiunits-sources
)
set_property(TARGET wpiunits_src_jar PROPERTY FOLDER "java")
install_jar(wpiunits_src_jar DESTINATION ${java_lib_dest})
endif()