--- src/CMakeLists.txt.orig 2019-08-20 17:53:35.000000000 -0600
+++ src/CMakeLists.txt 2019-08-20 18:01:51.000000000 -0600
add_library(libz3 ${lib_type} ${object_files})
+add_library(libz3-static STATIC ${object_files})
set_target_properties(libz3 PROPERTIES
# VERSION determines the version in the filename of the shared library.
# SOVERSION determines the value of the DT_SONAME field on ELF platforms.
SOVERSION ${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR})
+set_target_properties(libz3-static PROPERTIES
+ SOVERSION ${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR})
+set_target_properties(libz3-static PROPERTIES OUTPUT_NAME z3)
# On UNIX like platforms if we don't change the OUTPUT_NAME
# the library gets a name like ``liblibz3.so`` so we change it
# shared library the dependent libraries are specified on the link command line
# so that if those are also shared libraries they are referenced by `libz3.so`.
target_link_libraries(libz3 PRIVATE ${Z3_DEPENDENT_LIBS})
+target_link_libraries(libz3-static PRIVATE ${Z3_DEPENDENT_LIBS})
# This is currently only for the OpenMP flags. It needs to be set
# via `target_link_libraries()` rather than `z3_append_linker_flag_list_to_target()`
# the link dependencies need to be exported too.
foreach (flag_name ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
target_link_libraries(libz3 PRIVATE ${flag_name})
+ target_link_libraries(libz3-static PRIVATE ${flag_name})
# Declare which header file are the public header files of libz3
set_property(TARGET libz3 APPEND PROPERTY
PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/util/z3_version.h")
+install(TARGETS libz3 libz3-static
EXPORT Z3_EXPORTED_TARGETS
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" # On Windows this installs ``libz3.lib`` which CMake calls the "corresponding import library". Do we want this installed?