cmake: Fix include of CVC4JavaTargets.cmake. (#3373)
authorMathias Preiner <mathias.preiner@gmail.com>
Wed, 9 Oct 2019 00:55:05 +0000 (17:55 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Oct 2019 00:55:05 +0000 (17:55 -0700)
Only include Java targets if Java bindings are enabled.

cmake/CVC4Config.cmake.in

index 86fbffff586636fb20fb528cc8d45b6bcbbfd780..f60e99736bcca22364d0ab9683f5bde41a8de18f 100644 (file)
@@ -1,10 +1,12 @@
 @PACKAGE_INIT@
 
+set(CVC4_BINDINGS_JAVA @BUILD_BINDINGS_JAVA@)
+
 if(NOT TARGET CVC4::cvc4)
   include(${CMAKE_CURRENT_LIST_DIR}/CVC4Targets.cmake)
 endif()
 
-if(NOT TARGET CVC4::cvc4jar)
+if(CVC4_BINDINGS_JAVA AND NOT TARGET CVC4::cvc4jar)
   set_and_check(CVC4_JNI_PATH "@PACKAGE_LIBRARY_INSTALL_DIR@")
   include(${CMAKE_CURRENT_LIST_DIR}/CVC4JavaTargets.cmake)
 endif()