The UseJava module's add_jar() command now accepts a new option INCLUDE_MODULES that adds its arguments to the --module-path argument to the Java compiler. This allows building JAR files that use JPMS modules in their build.
UseJava
add_jar()
0-sample-topic
CMake 4.2 Release Notes