From 91fb646f556730f73556857ea25f35dfcccbb547 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Fri, 17 Sep 2021 19:03:10 +0200 Subject: [PATCH] Fix Z3Config.cmake.in when generating a static library (#5555) --- cmake/Z3Config.cmake.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/Z3Config.cmake.in b/cmake/Z3Config.cmake.in index dbd63b10313..05570fcf94d 100644 --- a/cmake/Z3Config.cmake.in +++ b/cmake/Z3Config.cmake.in @@ -10,6 +10,21 @@ # This file was built for the @CONFIG_FILE_TYPE@. ################################################################################ + +# Handle dependencies (necessary when compiling the static library) +if(NOT @Z3_BUILD_LIBZ3_SHARED@) + include(CMakeFindDependencyMacro) + + # Threads::Threads + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_dependency(Threads) + + # GMP::GMP + if(@Z3_USE_LIB_GMP@) + find_dependency(GMP) + endif() +endif() + # Exported targets include("${CMAKE_CURRENT_LIST_DIR}/Z3Targets.cmake")