From 6f2daa4e9834d0348c7eeec0dcb3dddbd98ca934 Mon Sep 17 00:00:00 2001 From: Aina Niemetz Date: Mon, 17 Sep 2018 11:07:31 -0700 Subject: [PATCH] cmake: More documentation, clean up. --- doc/CMakeLists.txt | 8 ++++++++ src/CMakeLists.txt | 14 ++++++++++++-- src/main/CMakeLists.txt | 13 +++++++++++++ src/parser/CMakeLists.txt | 14 +++++++++++--- test/regress/CMakeLists.txt | 19 ++++++++++++++++++- test/unit/base/CMakeLists.txt | 3 +++ test/unit/context/CMakeLists.txt | 3 +++ test/unit/expr/CMakeLists.txt | 3 +++ test/unit/main/CMakeLists.txt | 3 +++ test/unit/parser/CMakeLists.txt | 3 +++ test/unit/preprocessing/CMakeLists.txt | 3 +++ test/unit/prop/CMakeLists.txt | 3 +++ test/unit/util/CMakeLists.txt | 3 +++ 13 files changed, 86 insertions(+), 6 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index ffa8b7725..5f71dd2b4 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,7 +1,12 @@ +#-----------------------------------------------------------------------------# # Set variables required for the documentation *.in files + string(TIMESTAMP MAN_DATE "%Y-%m-%d") set(VERSION CVC4_RELEASE_STRING) +#-----------------------------------------------------------------------------# +# Generate files + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/SmtEngine.3cvc_template.in ${CMAKE_CURRENT_BINARY_DIR}/SmtEngine.3cvc_template) @@ -26,6 +31,9 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/options.3cvc_template.in ${CMAKE_CURRENT_BINARY_DIR}/options.3cvc_template) +#-----------------------------------------------------------------------------# +# Install man pages + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cvc4.1 DESTINATION share/man/man1) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cvc4.5 DESTINATION share/man/man5) if(ENABLE_PORTFOLIO) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 17d7fd814..4ba64c11a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# Collect libcvc4 source files + libcvc4_add_sources( api/cvc4cpp.cpp api/cvc4cpp.h @@ -646,10 +649,15 @@ libcvc4_add_sources( theory/valuation.h ) +#-----------------------------------------------------------------------------# # Add required include paths for this and all subdirectories. + include_directories(include) include_directories(. ${CMAKE_CURRENT_BINARY_DIR}) +#-----------------------------------------------------------------------------# +# Add subdirectories + add_subdirectory(base) add_subdirectory(expr) add_subdirectory(main) @@ -658,8 +666,10 @@ add_subdirectory(parser) add_subdirectory(theory) add_subdirectory(util) -# All sources for libcvc4 are now collected via libcvc4_add_sources. We can -# now build libcvc4. +#-----------------------------------------------------------------------------# +# All sources for libcvc4 are now collected in LIBCVC4_SRCS and (if generated) +# LIBCVC4_GEN_SRCS (via libcvc4_add_sources). We can now build libcvc4. + set_source_files_properties(${LIBCVC4_GEN_SRCS} PROPERTIES GENERATED TRUE) add_library(cvc4 ${LIBCVC4_SRCS} ${LIBCVC4_GEN_SRCS}) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index a0cbd3b77..39c4b2779 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# libmain source files + set(libmain_src_files command_executor.cpp driver_unified.cpp @@ -7,8 +10,10 @@ set(libmain_src_files util.cpp ) +#-----------------------------------------------------------------------------# # Build object library since we will use the object files for cvc4-bin, # pcvc4-bin, and main-test library. + add_library(main OBJECT ${libmain_src_files}) target_compile_definitions(main PRIVATE -D__BUILDING_CVC4DRIVER) if(BUILD_SHARED_LIBS) @@ -29,6 +34,9 @@ target_include_directories(main PRIVATE ${LIBCVC4_INCLUDES}) add_library(main-test $) target_link_libraries(main-test cvc4 cvc4parser) +#-----------------------------------------------------------------------------# +# cvc4 binary configuration + add_executable(cvc4-bin main.cpp $) target_compile_definitions(cvc4-bin PRIVATE -D__BUILDING_CVC4DRIVER) set_target_properties(cvc4-bin @@ -69,6 +77,9 @@ if(USE_READLINE) endif() endif() +#-----------------------------------------------------------------------------# +# Generate language tokens header files. + foreach(lang Cvc Smt1 Smt2 Tptp) string(TOLOWER ${lang} lang_lc) add_custom_command( @@ -81,6 +92,7 @@ foreach(lang Cvc Smt1 Smt2 Tptp) ) endforeach() +# Create target used as a dependency for libmain. add_custom_target(gen-tokens DEPENDS cvc_tokens.h @@ -88,3 +100,4 @@ add_custom_target(gen-tokens smt2_tokens.h tptp_tokens.h ) + diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt index 389ebd814..b18573fe5 100644 --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -8,7 +8,10 @@ endif() # Java runtime is required for ANTLR find_package(Java COMPONENTS Runtime REQUIRED) -set(cvc4parser_src_files +#-----------------------------------------------------------------------------# +# libcvc4parser source files + +set(libcvc4parser_src_files antlr_input.cpp antlr_input.h antlr_input_imports.cpp @@ -51,7 +54,9 @@ set(cvc4parser_src_files tptp/tptp_input.h ) +#-----------------------------------------------------------------------------# # Generate parsers for all supported languages + foreach(lang Cvc Smt1 Smt2 Tptp) string(TOLOWER ${lang} lang_dir) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${lang_dir}) @@ -78,10 +83,13 @@ foreach(lang Cvc Smt1 Smt2 Tptp) set_source_files_properties(${gen_src_files} PROPERTIES GENERATED TRUE) # Add generated source files to the parser source files - list(APPEND cvc4parser_src_files ${gen_src_files}) + list(APPEND libcvc4parser_src_files ${gen_src_files}) endforeach() -add_library(cvc4parser ${cvc4parser_src_files}) +#-----------------------------------------------------------------------------# +# libcvc4parser configuration + +add_library(cvc4parser ${libcvc4parser_src_files}) set_target_properties(cvc4parser PROPERTIES SOVERSION ${CVC4_SOVERSION}) target_compile_definitions(cvc4parser PRIVATE -D__BUILDING_CVC4PARSERLIB) target_link_libraries(cvc4parser cvc4 ${ANTLR_LIBRARIES}) diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 9ecb218d8..e0bdc2bfc 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# Regression level 0 tests + set(regress_0_tests regress0/arith/arith.01.cvc regress0/arith/arith.02.cvc @@ -1005,6 +1008,9 @@ set(regress_0_tests regress0/sygus/hd-05-d1-prog-nogrammar.sy ) +#-----------------------------------------------------------------------------# +# Regression level 1 tests + set(regress_1_tests regress1/arith/arith-int-004.cvc regress1/arith/arith-int-011.cvc @@ -1640,6 +1646,9 @@ set(regress_1_tests regress1/wrong-qfabvfp-smtcomp2018.smt2 ) +#-----------------------------------------------------------------------------# +# Regression level 2 tests + set(regress_2_tests regress2/DTP_k2_n35_c175_s15.smt2 regress2/FIREFLY_3_e2_2236_e7_3681.ec.minimized.smt2 @@ -1717,6 +1726,9 @@ set(regress_2_tests regress2/xs-09-16-3-4-1-5.smt ) +#-----------------------------------------------------------------------------# +# Regression level 3 tests + set(regress_3_tests regress3/bmc-ibm-1.smt regress3/bmc-ibm-2.smt @@ -1732,6 +1744,9 @@ set(regress_3_tests regress3/qwh.35.405.shuffled-as.sat03-1651.smt ) +#-----------------------------------------------------------------------------# +# Regression level 4 tests + set(regress_4_tests regress4/C880mul.miter.shuffled-as.sat03-348.smt regress4/NEQ016_size5.smt @@ -1741,7 +1756,9 @@ set(regress_4_tests regress4/instance_1151.smt ) -# These tests will not be run. +#-----------------------------------------------------------------------------# +# Disabled tests, will not be run. + set(regression_disabled_tests regress0/arith/bug549.cvc regress0/arith/incorrect1.smt diff --git a/test/unit/base/CMakeLists.txt b/test/unit/base/CMakeLists.txt index 4c2a0517e..139d6d577 100644 --- a/test/unit/base/CMakeLists.txt +++ b/test/unit/base/CMakeLists.txt @@ -1 +1,4 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(map_util_black) diff --git a/test/unit/context/CMakeLists.txt b/test/unit/context/CMakeLists.txt index b332d7340..3d556ff6d 100644 --- a/test/unit/context/CMakeLists.txt +++ b/test/unit/context/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(cdlist_black) cvc4_add_unit_test_black(cdmap_black) cvc4_add_unit_test_white(cdmap_white) diff --git a/test/unit/expr/CMakeLists.txt b/test/unit/expr/CMakeLists.txt index ca5fcbe6d..816d3bd71 100644 --- a/test/unit/expr/CMakeLists.txt +++ b/test/unit/expr/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(attribute_black) cvc4_add_unit_test_white(attribute_white) cvc4_add_unit_test_black(expr_manager_public) diff --git a/test/unit/main/CMakeLists.txt b/test/unit/main/CMakeLists.txt index 7b90f0ca4..2b2497a4b 100644 --- a/test/unit/main/CMakeLists.txt +++ b/test/unit/main/CMakeLists.txt @@ -1 +1,4 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(interactive_shell_black) diff --git a/test/unit/parser/CMakeLists.txt b/test/unit/parser/CMakeLists.txt index fd3227be3..debe8a4ce 100644 --- a/test/unit/parser/CMakeLists.txt +++ b/test/unit/parser/CMakeLists.txt @@ -1,2 +1,5 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(parser_black) cvc4_add_unit_test_black(parser_builder_black) diff --git a/test/unit/preprocessing/CMakeLists.txt b/test/unit/preprocessing/CMakeLists.txt index fdd32be95..5f8a79055 100644 --- a/test/unit/preprocessing/CMakeLists.txt +++ b/test/unit/preprocessing/CMakeLists.txt @@ -1 +1,4 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_white(pass_bv_gauss_white) diff --git a/test/unit/prop/CMakeLists.txt b/test/unit/prop/CMakeLists.txt index c712d7277..990422445 100644 --- a/test/unit/prop/CMakeLists.txt +++ b/test/unit/prop/CMakeLists.txt @@ -1 +1,4 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_white(cnf_stream_white) diff --git a/test/unit/util/CMakeLists.txt b/test/unit/util/CMakeLists.txt index 3763c72ce..79e5e78ff 100644 --- a/test/unit/util/CMakeLists.txt +++ b/test/unit/util/CMakeLists.txt @@ -1,3 +1,6 @@ +#-----------------------------------------------------------------------------# +# Add unit tests + cvc4_add_unit_test_black(array_store_all_black) cvc4_add_unit_test_white(assert_white) cvc4_add_unit_test_black(binary_heap_black) -- 2.30.2