diff --git a/CMakeLists.txt b/CMakeLists.txt index e7592ac89c..fcf78ed430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,9 @@ endif() if(WITH_WPILIB) set(APRILTAG_DEP_REPLACE "find_dependency(apriltag)") set(WPILIBC_DEP_REPLACE "find_dependency(wpilibc)") - set(WPILIBJ_DEP_REPLACE "find_dependency(wpilibj)") + if(WITH_JAVA) + set(WPILIBJ_DEP_REPLACE "find_dependency(wpilibj)") + endif() set(WPILIBNEWCOMMANDS_DEP_REPLACE "find_dependency(wpilibNewCommands)") add_subdirectory(apriltag) add_subdirectory(wpilibj)