# Whether CVC4 is built with the (optional) GPLed library dependences.
set(CVC4_GPL_DEPS 0)
-#-----------------------------------------------------------------------------#
-
-find_package(PythonInterp REQUIRED)
-
-set(ANTLR_HOME ${ANTLR_DIR})
-find_package(ANTLR REQUIRED)
-
-set(GMP_HOME ${GMP_DIR})
-find_package(GMP REQUIRED)
-cvc4_link_library(${GMP_LIBRARIES})
-include_directories(${GMP_INCLUDE_DIR})
-
#-----------------------------------------------------------------------------#
# Compiler flags
cvc4_set_option(ENABLE_SHARED ON)
cvc4_set_option(ENABLE_VALGRIND OFF)
+#-----------------------------------------------------------------------------#
+
+# This needs to be set before any find_package(...) command since we want to
+# search for static libraries with suffix .a.
+if(NOT ENABLE_SHARED)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ set(CMAKE_EXE_LINKER_FLAGS "-static")
+ set(BUILD_SHARED_LIBS OFF)
+endif()
+
+find_package(PythonInterp REQUIRED)
+
+set(ANTLR_HOME ${ANTLR_DIR})
+find_package(ANTLR REQUIRED)
+
+set(GMP_HOME ${GMP_DIR})
+find_package(GMP REQUIRED)
+cvc4_link_library(${GMP_LIBRARIES})
+include_directories(${GMP_INCLUDE_DIR})
+
+
#-----------------------------------------------------------------------------#
# Enable the ctest testing framework