cmake: Move find_package to where it is actually needed.
authorMathias Preiner <mathias.preiner@gmail.com>
Mon, 10 Sep 2018 18:35:14 +0000 (11:35 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 23:30:59 +0000 (16:30 -0700)
CMakeLists.txt
src/parser/CMakeLists.txt
src/parser/cvc/CMakeLists.txt
src/parser/smt1/CMakeLists.txt
src/parser/smt2/CMakeLists.txt
src/parser/tptp/CMakeLists.txt
src/util/CMakeLists.txt

index 5aa67f6c08161781ea4c21a0105a7dec8a3fe18d..f1e20e5f3c198fb40829ed62b72b10895c93b575 100644 (file)
@@ -306,18 +306,6 @@ endif()
 
 find_package(PythonInterp REQUIRED)
 
-set(ANTLR_HOME ${ANTLR_DIR})
-find_package(ANTLR REQUIRED)
-
-# Java runtime is required for ANTLR
-find_package(Java COMPONENTS Runtime REQUIRED)
-
-set(GMP_HOME ${GMP_DIR})
-find_package(GMP REQUIRED)
-libcvc4_link_libraries(${GMP_LIBRARIES})
-libcvc4_include_directories(${GMP_INCLUDE_DIR})
-
-
 #-----------------------------------------------------------------------------#
 # Enable the ctest testing framework
 
index 6a7f77ea35ccad5b8dbf2998ccc8c84cc3f2b054..52fa55f9d47341f82dfba482d822abaed71f1e90 100644 (file)
@@ -23,6 +23,12 @@ set(cvc4parser_src_files
   parser_exception.h
 )
 
+set(ANTLR_HOME ${ANTLR_DIR})
+find_package(ANTLR REQUIRED)
+
+# Java runtime is required for ANTLR
+find_package(Java COMPONENTS Runtime REQUIRED)
+
 add_library(cvc4parser ${cvc4parser_src_files})
 
 set_target_properties(cvc4parser
index ab88ffe1b3729c2a8d4c72577415d888b1c52b5c..c75df0ab4dc5ed69dd657403ccb1d889dadeed08 100644 (file)
@@ -14,7 +14,6 @@ add_custom_command(
     ${ANTLR_BINARY}
       ${CMAKE_CURRENT_SOURCE_DIR}/Cvc.g
       -fo ${CMAKE_CURRENT_BINARY_DIR}
-      2> /dev/null # Ignore Antlr3 warnings
   DEPENDS
     Cvc.g
 )
index 2dd0bfd9b106ffea19f2f07641bab6149dc1dc82..cd27bb5130457fe9a8a76fea99efa0e6f4efdac8 100644 (file)
@@ -16,7 +16,6 @@ add_custom_command(
     ${ANTLR_BINARY}
       ${CMAKE_CURRENT_SOURCE_DIR}/Smt1.g
       -fo ${CMAKE_CURRENT_BINARY_DIR}
-      2> /dev/null # Ignore Antlr3 warnings
   DEPENDS
     Smt1.g
 )
index 90cc391b04c1c85aadbc369f787bb7497451f044..f3258839e56d7806c34d0e6887c0f2b23e125cc2 100644 (file)
@@ -18,7 +18,6 @@ add_custom_command(
     ${ANTLR_BINARY}
       ${CMAKE_CURRENT_SOURCE_DIR}/Smt2.g
       -fo ${CMAKE_CURRENT_BINARY_DIR}
-      2> /dev/null # Ignore Antlr3 warnings
   DEPENDS
     Smt2.g
 )
index aadd47a2a91e89712b47ab25c1c207318d21c024..5712e8175e4b4967fc23ce15a864616a9e066f98 100644 (file)
@@ -16,7 +16,6 @@ add_custom_command(
     ${ANTLR_BINARY}
       ${CMAKE_CURRENT_SOURCE_DIR}/Tptp.g
       -fo ${CMAKE_CURRENT_BINARY_DIR}
-      2> /dev/null # Ignore Antlr3 warnings
   DEPENDS
     Tptp.g
 )
index de748ad9891daffc303fc0beefb69b547f8857cd..c18f45a125ea2570977a08acfdb2c9872c238b8c 100644 (file)
@@ -58,6 +58,10 @@ if(CVC4_USE_GMP_IMP)
   list(APPEND util_src_files rational_gmp_imp.cpp integer_gmp_imp.cpp)
 endif()
 
+set(GMP_HOME ${GMP_DIR})
+find_package(GMP REQUIRED)
+
 add_library(util ${util_src_files})
 target_compile_definitions(util PRIVATE -D__BUILDING_CVC4LIB)
-target_link_libraries(util options)
+target_link_libraries(util options ${GMP_LIBRARIES})
+target_include_directories(util PUBLIC ${GMP_INCLUDE_DIR})