Skip to content
Snippets Groups Projects
Commit 35914e18 authored by David Gobbi's avatar David Gobbi
Browse files

Fix java build failure for 'make'

Recent changes to fix the dependencies of vtkjava_tests for Ninja
have caused problems with dependencies for Unix Makefiles.  This
change makes those previous fixes specific to Ninja, in order to
get the build working properly with Unix Makefiles again.
parent 295831c6
No related branches found
No related tags found
No related merge requests found
......@@ -275,10 +275,11 @@ install(
DESTINATION "${vtk_cmake_destination}"
COMPONENT "development")
# We need this for targets that depends in vtkjava to
# delay its source code compilation until the vtkjava JAR file is
# generated.
add_custom_target(vtkjava_jar DEPENDS "$<TARGET_FILE:vtkjava>")
if (CMAKE_GENERATOR MATCHES "Ninja")
# We need this for targets that depends in vtkjava to delay its
# source code compilation until the vtkjava JAR file is generated.
add_custom_target(vtkjava_jar DEPENDS "$<TARGET_FILE:vtkjava>")
endif ()
if (VTK_BUILD_TESTING AND TARGET VTK::TestingRendering)
add_subdirectory(Testing)
......
......@@ -34,11 +34,17 @@ target_compile_options(vtkjava_tests
target_link_libraries(vtkjava_tests
PRIVATE
VTK::vtkjava)
# Apparently the Java compilation doesn't set up dependencies properly,
# Thus we need to depend on vtkjava_jar which symbolized that the vtkjava
# jar file has been created. This is needed since compiling every java file
# requires to have the jars in the classpath of its dependencies.
add_dependencies(vtkjava_tests vtkjava_jar WrapJava)
if (TARGET vtkjava_jar)
# Apparently the Java compilation doesn't set up dependencies properly,
# Thus we need to depend on vtkjava_jar which symbolized that the vtkjava
# jar file has been created. This is needed since compiling every java file
# requires to have the jars in the classpath of its dependencies.
add_dependencies(vtkjava_tests vtkjava_jar WrapJava)
else ()
# If 'vtkjava_jar' doesn't exist, we assume that dependencies are properly
# handled via the 'vtkjava' target for the vtk.jar file
add_dependencies(vtkjava_tests vtkjava)
endif ()
set(vtk_test_classpath
"$<TARGET_FILE:vtkjava_tests>"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment