cmake: Cleanup CMakeLists.txt files, remove SHARED.
authorMathias Preiner <mathias.preiner@gmail.com>
Wed, 15 Aug 2018 00:32:26 +0000 (17:32 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 23:30:59 +0000 (16:30 -0700)
19 files changed:
CMakeLists.txt
src/CMakeLists.txt
src/base/CMakeLists.txt
src/base/git_versioninfo.cpp.in [new file with mode: 0644]
src/compat/CMakeLists.txt
src/expr/CMakeLists.txt
src/git_versioninfo.cpp.in [deleted file]
src/lib/CMakeLists.txt
src/main/CMakeLists.txt
src/options/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/prop/bvminisat/CMakeLists.txt
src/prop/minisat/CMakeLists.txt
src/smt_util/CMakeLists.txt
src/util/CMakeLists.txt

index 7a3c13085475000b93d38c8e927e09ab6b28f9a1..a0bc529ca3e944d4c45d0bed52501bfeee9672df 100644 (file)
@@ -157,10 +157,7 @@ set(CVC4_BUILD_PROFILE_COMPETITION 0)
 #-----------------------------------------------------------------------------#
 
 find_package(PythonInterp REQUIRED)
-
 find_package(ANTLR REQUIRED)
-cvc4_link_library(${ANTLR_LIBRARIES})
-include_directories(${ANTLR_INCLUDE_DIR})
 
 find_package(GMP REQUIRED)
 cvc4_link_library(${GMP_LIBRARIES})
index f8c9752f0fe1d12bb909f1b6793ede8855959c3e..a5328843f2e9e0b7045e87ca3b11a494354fee07 100644 (file)
@@ -1,10 +1,4 @@
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/git_versioninfo.cpp.in
-  ${CMAKE_CURRENT_BINARY_DIR}/git_versioninfo.cpp
-)
-
 set(cvc4_src_files
-  ${CMAKE_CURRENT_BINARY_DIR}/git_versioninfo.cpp
   api/cvc4cpp.cpp
   api/cvc4cpp.h
   api/cvc4cppkind.h
@@ -566,13 +560,12 @@ set(cvc4_gen_src_files
 # tell cmake that the files are generated.
 set_source_files_properties(${cvc4_gen_src_files} PROPERTIES GENERATED TRUE)
 
-add_library(cvc4 SHARED ${cvc4_src_files} ${cvc4_gen_src_files})
-set_target_properties(cvc4
-  PROPERTIES
-    COMPILE_DEFINITIONS
-      __BUILDING_CVC4LIB
-      __STDC_LIMIT_MACROS
-      __STDC_FORMAT_MACROS
+add_library(cvc4 ${cvc4_src_files} ${cvc4_gen_src_files})
+target_compile_definitions(cvc4
+  PRIVATE
+    -D__BUILDING_CVC4LIB
+    -D__STDC_LIMIT_MACROS
+    -D__STDC_FORMAT_MACROS
 )
 add_dependencies(cvc4 gen-theory-files)
 target_link_libraries(cvc4
index ea44c4fc33b9e6404482994375e1761074cbcb65..dc0b7c09c31490df31417fa24c5df33e36364611 100644 (file)
@@ -1,3 +1,5 @@
+configure_file(git_versioninfo.cpp.in git_versioninfo.cpp)
+
 set(base_src_files
   configuration.cpp
   configuration.h
@@ -15,8 +17,9 @@ set(base_src_files
   output.h
 )
 
-add_library(base SHARED ${base_src_files})
-set_target_properties(base PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
+add_library(base
+  ${base_src_files} ${CMAKE_CURRENT_BINARY_DIR}/git_versioninfo.cpp)
+target_compile_definitions(base PRIVATE -D__BUILDING_CVC4LIB)
 add_dependencies(base tags_headers)
 
 #
diff --git a/src/base/git_versioninfo.cpp.in b/src/base/git_versioninfo.cpp.in
new file mode 100644 (file)
index 0000000..e601a85
--- /dev/null
@@ -0,0 +1,5 @@
+#include "base/configuration.h"
+const bool ::CVC4::Configuration::IS_GIT_BUILD = true;
+const char* const ::CVC4::Configuration::GIT_BRANCH_NAME = "@GIT_BRANCH@";
+const char* const ::CVC4::Configuration::GIT_COMMIT = "@GIT_SHA1@";
+const bool ::CVC4::Configuration::GIT_HAS_MODIFICATIONS = @GIT_IS_DIRTY@;
index 92b6aabfa3ab0ff71128d97685ddb616b9d1e887..f327de593eb6f310cb15472d38a387f0d1d77bdf 100644 (file)
@@ -3,7 +3,6 @@ set(compat_src_files
   cvc3_compat.h
 )
 
-add_library(cvc4compat SHARED ${compat_src_files})
-set_target_properties(cvc4compat
-  PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4COMPATLIB)
+add_library(cvc4compat ${compat_src_files})
+target_compile_definitions(cvc4compat PRIVATE -D__BUILDING_CVC4COMPATLIB)
 target_link_libraries(cvc4compat cvc4)
index a2e55f8748cdaadd52630b32a9898cb75122e9a7..dd3d83481a2249639b092a101c2a7dedaed15060 100644 (file)
@@ -60,8 +60,8 @@ set(expr_gen_src_files
   type_properties.h
 )
 
-add_library(expr SHARED ${expr_src_files} ${expr_gen_src_files})
-set_target_properties(expr PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
+add_library(expr ${expr_src_files} ${expr_gen_src_files})
+target_compile_definitions(expr PRIVATE -D__BUILDING_CVC4LIB)
 
 #
 # Generate code for kinds.
diff --git a/src/git_versioninfo.cpp.in b/src/git_versioninfo.cpp.in
deleted file mode 100644 (file)
index e601a85..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "base/configuration.h"
-const bool ::CVC4::Configuration::IS_GIT_BUILD = true;
-const char* const ::CVC4::Configuration::GIT_BRANCH_NAME = "@GIT_BRANCH@";
-const char* const ::CVC4::Configuration::GIT_COMMIT = "@GIT_SHA1@";
-const bool ::CVC4::Configuration::GIT_HAS_MODIFICATIONS = @GIT_IS_DIRTY@;
index b56a0bb821c5dbd2e7c255efb7ad0e242cb60691..ffebfed829953f5f8d6177e2e6b8f04264ee874a 100644 (file)
@@ -8,5 +8,5 @@ set(replacements_src_files
   strtok_r.h
 )
 
-add_library(replacements SHARED ${replacements_src_files})
-set_target_properties(replacements PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
+add_library(replacements ${replacements_src_files})
+target_compile_definitions(replacements PRIVATE -D__BUILDING_CVC4LIB)
index 1a586f8348533e9f7808f0beff2456ca8fbae8c7..a66ab5a1e7fe9ea65ef564088bcc7053c6f39cc3 100644 (file)
@@ -5,8 +5,8 @@ set(libmain_src_files
   util.cpp
 )
 
-add_library(main SHARED ${libmain_src_files})
-set_target_properties(main PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4DRIVER)
+add_library(main ${libmain_src_files})
+target_compile_definitions(main PRIVATE -D__BUILDING_CVC4DRIVER)
 target_link_libraries(main cvc4 cvc4parser)
 
 set(cvc4main_src_files
@@ -16,11 +16,9 @@ set(cvc4main_src_files
 )
 
 add_executable(cvc4-main ${cvc4main_src_files})
-set_target_properties(cvc4-main
-  PROPERTIES
-    OUTPUT_NAME cvc4
-    COMPILE_DEFINITIONS __BUILDING_CVC4DRIVER)
-target_link_libraries(cvc4-main main) #cvc4 cvc4parser replacements)
+target_compile_definitions(cvc4-main PRIVATE -D__BUILDING_CVC4DRIVER)
+set_target_properties(cvc4-main PROPERTIES OUTPUT_NAME cvc4)
+target_link_libraries(cvc4-main main)
 
 #set(pcvc4_src_files
 #  main.cpp
index 5fcc22bd933cb8b579f05f13984d16e29f865344..10511867f812f5a689d00729e15911df297181e9 100644 (file)
@@ -101,5 +101,5 @@ set(options_src_files
   ufss_mode.h
 )
 
-add_library(options SHARED options.cpp ${options_gen_cpp_files} ${options_src_files})
-set_target_properties(options PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
+add_library(options options.cpp ${options_gen_cpp_files} ${options_src_files})
+target_compile_definitions(options PRIVATE -D__BUILDING_CVC4LIB)
index 8c0a65fa79422699f1a786d5f19044671e20cb9a..bc8861ea8f5bf9e9d59c28fd3292e6f1f11230d7 100644 (file)
@@ -23,10 +23,13 @@ set(cvc4parser_src_files
   parser_exception.h
 )
 
-add_library(cvc4parser SHARED ${cvc4parser_src_files})
-set_target_properties(cvc4parser PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4PARSERLIB)
+add_library(cvc4parser ${cvc4parser_src_files})
+target_compile_definitions(cvc4parser PRIVATE -D__BUILDING_CVC4PARSERLIB)
 target_link_libraries(cvc4parser parsercvc parsersmt1 parsersmt2 parsertptp cvc4)
+target_link_libraries(cvc4parser ${ANTLR_LIBRARIES})
 
+# ANTLR includes required for all subdirectories
+include_directories(cvc4parser PRIVATE ${ANTLR_INCLUDE_DIR})
 add_subdirectory(cvc)
 add_subdirectory(smt1)
 add_subdirectory(smt2)
index 8f27cbb2555e1cb16a064ca23bb783b2684e7d20..ab88ffe1b3729c2a8d4c72577415d888b1c52b5c 100644 (file)
@@ -19,7 +19,7 @@ add_custom_command(
     Cvc.g
 )
 
-add_library(parsercvc SHARED ${parser_cvc_src_files} ${parser_cvc_gen_src_files})
-set_target_properties(parsercvc PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4PARSERLIB)
+add_library(parsercvc ${parser_cvc_src_files} ${parser_cvc_gen_src_files})
+target_compile_definitions(parsercvc PRIVATE -D__BUILDING_CVC4PARSERLIB)
 set_source_files_properties(${parser_cvc_gen_src_files} PROPERTIES LANGUAGE CXX)
-add_dependencies(parsercvc expr)
+target_link_libraries(parsercvc expr)
index 89f440e8ed2edb51eca14425effc3ac6d01783bf..2dd0bfd9b106ffea19f2f07641bab6149dc1dc82 100644 (file)
@@ -21,7 +21,7 @@ add_custom_command(
     Smt1.g
 )
 
-add_library(parsersmt1 SHARED ${parser_smt1_src_files} ${parser_smt1_gen_src_files})
-set_target_properties(parsersmt1 PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4PARSERLIB)
+add_library(parsersmt1 ${parser_smt1_src_files} ${parser_smt1_gen_src_files})
+target_compile_definitions(parsersmt1 PRIVATE -D__BUILDING_CVC4PARSERLIB)
 set_source_files_properties(${parser_smt1_gen_src_files} PROPERTIES LANGUAGE CXX)
-add_dependencies(parsersmt1 expr)
+target_link_libraries(parsersmt1 expr)
index b046a6767b6bc787432c4ad798e00459d82b3be3..90cc391b04c1c85aadbc369f787bb7497451f044 100644 (file)
@@ -23,7 +23,7 @@ add_custom_command(
     Smt2.g
 )
 
-add_library(parsersmt2 SHARED ${parser_smt2_src_files} ${parser_smt2_gen_src_files})
-set_target_properties(parsersmt2 PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4PARSERLIB)
+add_library(parsersmt2 ${parser_smt2_src_files} ${parser_smt2_gen_src_files})
+target_compile_definitions(parsersmt2 PRIVATE -D__BUILDING_CVC4PARSERLIB)
 set_source_files_properties(${parser_smt2_gen_src_files} PROPERTIES LANGUAGE CXX)
-add_dependencies(parsersmt2 expr)
+target_link_libraries(parsersmt2 expr)
index 22593e7b2779d1271c3b2053bd7ed17696556adb..aadd47a2a91e89712b47ab25c1c207318d21c024 100644 (file)
@@ -21,7 +21,7 @@ add_custom_command(
     Tptp.g
 )
 
-add_library(parsertptp SHARED ${parser_tptp_src_files} ${parser_tptp_gen_src_files})
-set_target_properties(parsertptp PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4PARSERLIB)
+add_library(parsertptp ${parser_tptp_src_files} ${parser_tptp_gen_src_files})
+target_compile_definitions(parsertptp PRIVATE -D__BUILDING_CVC4PARSERLIB)
 set_source_files_properties(${parser_tptp_gen_src_files} PROPERTIES LANGUAGE CXX)
-add_dependencies(parsertptp expr)
+target_link_libraries(parsertptp expr)
index f55d74c486ffb782ffe32e404b0a766ffc68cfb1..3a5d4dba2067a07f758adc060944937d149f4a68 100644 (file)
@@ -19,13 +19,12 @@ set(bvminisat_src_files
   utils/Options.h
 )
 
-include_directories(.)
-add_library(bvminisat SHARED ${bvminisat_src_files})
-set_target_properties(bvminisat
-  PROPERTIES
-    COMPILE_DEFINITIONS
-      __BUILDING_CVC4LIB
-      __STDC_LIMIT_MACROS
-      __STDC_FORMAT_MACROS
+add_library(bvminisat ${bvminisat_src_files})
+target_include_directories(bvminisat PRIVATE .)
+target_compile_definitions(bvminisat
+  PRIVATE
+    -D__BUILDING_CVC4LIB
+    -D__STDC_LIMIT_MACROS
+    -D__STDC_FORMAT_MACROS
 )
-add_dependencies(bvminisat expr)
+target_link_libraries(bvminisat expr)
index 137b15766a8ae89653bb6aa1cc8fff0527f2a990..fee8233bd3fa7731c28c6e9401383d73ab247027 100644 (file)
@@ -19,13 +19,12 @@ set(minisat_src_files
   utils/Options.h
 )
 
-include_directories(.)
-add_library(minisat SHARED ${minisat_src_files})
-set_target_properties(minisat
-  PROPERTIES
-    COMPILE_DEFINITIONS
-      __BUILDING_CVC4LIB
-      __STDC_LIMIT_MACROS
-      __STDC_FORMAT_MACROS
+add_library(minisat ${minisat_src_files})
+target_include_directories(minisat PRIVATE .)
+target_compile_definitions(minisat
+  PRIVATE
+    -D__BUILDING_CVC4LIB
+    -D__STDC_LIMIT_MACROS
+    -D__STDC_FORMAT_MACROS
 )
-add_dependencies(minisat expr)
+target_link_libraries(minisat expr)
index 9934db3505d4b1e98c1bd39e5d2473b1eccb3946..f0c61de3b75beecb554bc710b9042a87e42261d2 100644 (file)
@@ -10,6 +10,6 @@ set(smtutil_src_files
   node_visitor.h
 )
 
-add_library(smtutil SHARED ${smtutil_src_files})
-set_target_properties(smtutil PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
+add_library(smtutil ${smtutil_src_files})
+target_compile_definitions(smtutil PRIVATE -D__BUILDING_CVC4LIB)
 target_link_libraries(smtutil expr)
index 54c92137134f558b9cb18adcfe2f48408abbb9b0..724a1ae5a28a164053a67d966051f78d549f05d5 100644 (file)
@@ -1,14 +1,6 @@
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/floatingpoint.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/floatingpoint.h)
-
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/rational.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/rational.h)
-
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/integer.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/integer.h)
+configure_file(floatingpoint.h.in floatingpoint.h)
+configure_file(rational.h.in rational.h)
+configure_file(integer.h.in integer.h)
 
 set(util_src_files
   abstract_value.cpp
@@ -68,6 +60,6 @@ if(CVC4_USE_GMP_IMP)
   list(APPEND util_src_files rational_gmp_imp.cpp integer_gmp_imp.cpp)
 endif()
 
-add_library(util SHARED ${util_src_files})
-set_target_properties(util PROPERTIES COMPILE_DEFINITIONS __BUILDING_CVC4LIB)
-add_dependencies(util options)
+add_library(util ${util_src_files})
+target_compile_definitions(util PRIVATE -D__BUILDING_CVC4LIB)
+target_link_libraries(util options)