From 7e84a4806975c321991935a3ae129edac7c545be Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Fri, 22 May 2020 00:10:41 +0800 Subject: [PATCH] Add pkg-config file (#4368) * Add pkg-config file * Copy z3.cmake.in to the Docker for CI --- CMakeLists.txt | 9 +++++++++ contrib/ci/Dockerfiles/z3_build.Dockerfile | 2 +- z3.pc.cmake.in | 13 +++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 z3.pc.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a7aee90bb..1ae3bce9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -568,6 +568,9 @@ write_basic_package_version_file("${PROJECT_BINARY_DIR}/Z3ConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/z3.pc.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/z3.pc" @ONLY) + ################################################################################ # Create `Z3Config.cmake` and related files for install tree so clients can use # Z3 via CMake. @@ -610,6 +613,12 @@ install( DESTINATION "${CMAKE_INSTALL_Z3_CMAKE_PACKAGE_DIR}" ) +# Add install rule to install ${PROJECT_BINARY_DIR}/z3.pc +install( + FILES "${PROJECT_BINARY_DIR}/z3.pc" + DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}" +) + ################################################################################ # Examples ################################################################################ diff --git a/contrib/ci/Dockerfiles/z3_build.Dockerfile b/contrib/ci/Dockerfiles/z3_build.Dockerfile index 02c30a354..f9e5bfe38 100644 --- a/contrib/ci/Dockerfiles/z3_build.Dockerfile +++ b/contrib/ci/Dockerfiles/z3_build.Dockerfile @@ -75,7 +75,7 @@ ADD /doc ${Z3_SRC_DIR}/doc/ ADD /examples ${Z3_SRC_DIR}/examples/ ADD /scripts ${Z3_SRC_DIR}/scripts/ ADD /src ${Z3_SRC_DIR}/src/ -ADD *.txt *.md RELEASE_NOTES ${Z3_SRC_DIR}/ +ADD *.txt *.md *.cmake.in RELEASE_NOTES ${Z3_SRC_DIR}/ ADD \ /contrib/ci/scripts/build_z3_cmake.sh \ diff --git a/z3.pc.cmake.in b/z3.pc.cmake.in new file mode 100644 index 000000000..af1969864 --- /dev/null +++ b/z3.pc.cmake.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_LIBDIR@ +sharedlibdir=@CMAKE_INSTALL_LIBDIR@ +includedir=@CMAKE_INSTALL_INCLUDEDIR@ + +Name: z3 +Description: The Z3 Theorem Prover +Version: @VERSION@ + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz3 +Cflags: -I${includedir}