Fix glpk, add antlr.so (#7341)
authorGereon Kremer <nafur42@gmail.com>
Tue, 12 Oct 2021 16:37:51 +0000 (09:37 -0700)
committerGitHub <noreply@github.com>
Tue, 12 Oct 2021 16:37:51 +0000 (16:37 +0000)
This PR makes the cmake integration of GLPK compatible with cmake 3.9.
Also, it adds a missing BUILD_BYPRODUCT for antlr.

cmake/FindANTLR3.cmake
src/CMakeLists.txt

index 9f56098642af93ea85f96e83e114a0a4a60dfc04..60622ab92804d14293f81829621af10cf3f55fd6 100644 (file)
@@ -128,6 +128,7 @@ if(NOT ANTLR3_FOUND_SYSTEM)
             ${64bit}
             --host=${TOOLCHAIN_PREFIX}
         BUILD_BYPRODUCTS <INSTALL_DIR>/${CMAKE_INSTALL_LIBDIR}/libantlr3c.a
+                         <INSTALL_DIR>/${CMAKE_INSTALL_LIBDIR}/libantlr3c.so
     )
 
     set(ANTLR3_JAR "${DEPS_BASE}/share/java/antlr-3.4-complete.jar")
index c00e92c8309f2193e65e8ee3be96bad267b9f298..52f2f2065e8230a3133b74daf62b716c887774e6 100644 (file)
@@ -1397,8 +1397,12 @@ if(USE_KISSAT)
   endif()
 endif()
 if(USE_GLPK)
+  target_include_directories(cvc5-obj PRIVATE ${GLPK_INCLUDE_DIR})
+  target_link_libraries(cvc5-shared PRIVATE ${GLPK_LIBRARIES})
+  if(ENABLE_STATIC_LIBRARY)
+    target_link_libraries(cvc5-static PUBLIC ${GLPK_LIBRARIES})
+  endif()
   target_link_libraries(cvc5-obj PUBLIC ${GLPK_LIBRARIES})
-  target_include_directories(cvc5-obj PUBLIC ${GLPK_INCLUDE_DIR})
 endif()
 if(USE_POLY)
   add_dependencies(cvc5-obj Polyxx_SHARED)