From: Mathias Preiner Date: Fri, 10 Aug 2018 23:10:23 +0000 (-0700) Subject: cmake: Antlr parser generation done. X-Git-Tag: cvc5-1.0.0~4620 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=424923f1317f3182574ebe730ebe0c81b7dbf494;p=cvc5.git cmake: Antlr parser generation done. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 87b281fe1..b93868fea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,7 @@ configure_file( add_subdirectory(src/base) add_subdirectory(src/expr) add_subdirectory(src/options) +add_subdirectory(src/parser) add_subdirectory(src/theory) add_subdirectory(proofs/signatures) include_directories(src ${CMAKE_CURRENT_BINARY_DIR}/src) diff --git a/cmake/FindANTLR.cmake b/cmake/FindANTLR.cmake index 5d5727186..e977ba88d 100644 --- a/cmake/FindANTLR.cmake +++ b/cmake/FindANTLR.cmake @@ -1,21 +1,26 @@ # Find ANTLR # ANTLR_FOUND - system has ANTLR lib +# ANTLR_BINARY - the ANTLR binary # ANTLR_INCLUDE_DIR - the ANTLR include directory # ANTLR_LIBRARIES - Libraries needed to use ANTLR +find_program(ANTLR_BINARY + NAMES antlr3 + PATHS "${PROJECT_SOURCE_DIR}/antlr-3.4/bin" + ) + find_path(ANTLR_INCLUDE_DIR NAMES antlr3.h PATHS "${PROJECT_SOURCE_DIR}/antlr-3.4/include" - NO_DEFAULT_PATH ) find_library(ANTLR_LIBRARIES NAMES antlr3c libantlr3c PATHS "${PROJECT_SOURCE_DIR}/antlr-3.4/lib" - NO_DEFAULT_PATH ) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ANTLR DEFAULT_MSG ANTLR_INCLUDE_DIR ANTLR_LIBRARIES) +find_package_handle_standard_args( + ANTLR DEFAULT_MSG ANTLR_BINARY ANTLR_INCLUDE_DIR ANTLR_LIBRARIES) -mark_as_advanced(ANTLR_INCLUDE_DIR ANTLR_LIBRARIES) +mark_as_advanced(ANTLR_BINARY ANTLR_INCLUDE_DIR ANTLR_LIBRARIES) diff --git a/src/parser/cvc/CMakeLists.txt b/src/parser/cvc/CMakeLists.txt index e69de29bb..1f176cfb6 100644 --- a/src/parser/cvc/CMakeLists.txt +++ b/src/parser/cvc/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(AntlrCvc + COMMAND + ${ANTLR_BINARY} + ${CMAKE_CURRENT_SOURCE_DIR}/Cvc.g + -fo ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS + Cvc.g +) +#add_dependencies(... AntlrCvc) diff --git a/src/parser/smt1/CMakeLists.txt b/src/parser/smt1/CMakeLists.txt index e69de29bb..f219d85d9 100644 --- a/src/parser/smt1/CMakeLists.txt +++ b/src/parser/smt1/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(AntlrSmt1 + COMMAND + ${ANTLR_BINARY} + ${CMAKE_CURRENT_SOURCE_DIR}/Smt1.g + -fo ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS + Smt1.g +) +#add_dependencies(... AntlrSmt1) diff --git a/src/parser/smt2/CMakeLists.txt b/src/parser/smt2/CMakeLists.txt index e69de29bb..d35f500bb 100644 --- a/src/parser/smt2/CMakeLists.txt +++ b/src/parser/smt2/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(AntlrSmt2 + COMMAND + ${ANTLR_BINARY} + ${CMAKE_CURRENT_SOURCE_DIR}/Smt2.g + -fo ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS + Smt2.g +) +#add_dependencies(... AntlrSmt2) diff --git a/src/parser/tptp/CMakeLists.txt b/src/parser/tptp/CMakeLists.txt index e69de29bb..bee38ce87 100644 --- a/src/parser/tptp/CMakeLists.txt +++ b/src/parser/tptp/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(AntlrTptp + COMMAND + ${ANTLR_BINARY} + ${CMAKE_CURRENT_SOURCE_DIR}/Tptp.g + -fo ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS + Tptp.g +) +#add_dependencies(... AntlrTptp)