cmake: Add portfolio support.
authorMathias Preiner <mathias.preiner@gmail.com>
Sat, 18 Aug 2018 01:11:26 +0000 (18:11 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 23:30:59 +0000 (16:30 -0700)
CMakeLists.txt
src/main/CMakeLists.txt

index 204e1016982f8ec2a824e591798b5d4f28cba32f..8e595776886bec4c59a014a94bca4cdb9f161a69 100644 (file)
@@ -138,6 +138,7 @@ cvc4_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols")
 cvc4_option(ENABLE_DUMPING       "Enable dumpin")
 cvc4_option(ENABLE_MUZZLE        "Enable silencing CVC4; supress ALL non-result output")
 cvc4_option(ENABLE_OPTIMIZED     "Enable optimization")
+cvc4_option(ENABLE_PORTFOLIO     "Enable portfolio support")
 cvc4_option(ENABLE_PROOFS        "Enable proof support")
 cvc4_option(ENABLE_REPLAY        "Enable the replay feature")
 cvc4_option(ENABLE_STATISTICS    "Enable statistics")
@@ -259,6 +260,17 @@ if(ENABLE_MUZZLE)
   add_definitions(-DCVC4_MUZZLE)
 endif()
 
+if(ENABLE_PORTFOLIO)
+  find_package(Boost REQUIRED COMPONENTS thread)
+  set(USE_CLN OFF)
+  set(THREADS_PREFER_PTHREAD_FLAG ON)
+  find_package(Threads REQUIRED)
+  if(THREADS_HAVE_PTHREAD_ARG)
+    add_c_cxx_flag(-pthread)
+  endif()
+  add_definitions(-DCVC4_PORTFOLIO)
+endif()
+
 if(ENABLE_PROFILING)
   add_definitions(-DCVC4_PROFILING)
   add_check_c_cxx_flag("-pg")
index 9d69abbcd25ac1102385351e747e67efb5b9cad2..23f16ccb747cb7a03d23fb021210840b1a378eba 100644 (file)
@@ -14,32 +14,38 @@ if(USE_READLINE)
   target_link_libraries(main ${Readline_LIBRARIES})
   target_include_directories(main PRIVATE ${Readline_INCLUDE_DIR})
 endif()
+add_dependencies(main token-headers)
 
-set(cvc4main_src_files
-  main.cpp
-)
-
-add_executable(cvc4-main ${cvc4main_src_files})
-target_compile_definitions(cvc4-main PRIVATE -D__BUILDING_CVC4DRIVER)
-set_target_properties(cvc4-main
+add_executable(cvc4-bin main.cpp)
+target_compile_definitions(cvc4-bin PRIVATE -D__BUILDING_CVC4DRIVER)
+set_target_properties(cvc4-bin
   PROPERTIES
     OUTPUT_NAME cvc4
     RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-target_link_libraries(cvc4-main main)
-add_dependencies(cvc4-main token-headers)
+target_link_libraries(cvc4-bin main)
 
-#set(pcvc4_src_files
-#  main.cpp
-#  portfolio.cpp
-#  portfolio.h
-#  portfolio_util.cpp
-#  portfolio_util.h
-#  command_executor.cpp
-#  command_executor_portfolio.cpp
-#  command_executor.h
-#  command_executor_portfolio.h
-#  driver_unified.cpp
-#)
+if(ENABLE_PORTFOLIO)
+  set(pcvc4_src_files
+    main.cpp
+    portfolio.cpp
+    portfolio.h
+    portfolio_util.cpp
+    portfolio_util.h
+    command_executor_portfolio.cpp
+    command_executor_portfolio.h
+  )
+
+  add_executable(pcvc4-bin ${pcvc4_src_files})
+  target_compile_definitions(pcvc4-bin PRIVATE -D__BUILDING_CVC4DRIVER)
+  set_target_properties(pcvc4-bin
+    PROPERTIES
+      OUTPUT_NAME pcvc4
+      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+  target_link_libraries(pcvc4-bin main)
+  add_dependencies(pcvc4-bin token-headers)
+  target_link_libraries(pcvc4-bin ${Boost_LIBRARIES})
+  target_include_directories(pcvc4-bin PRIVATE ${Boost_INCLUDE_DIRS})
+endif()
 
 add_custom_command(
   OUTPUT cvc_tokens.h