mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
Merge pull request #504 from delcypher/cmake_custom_install_dirs
[CMake] Provide a way to customise the install directories
This commit is contained in:
commit
9095d7db44
|
@ -321,9 +321,10 @@ message(STATUS "Z3_DEPENDENT_EXTRA_C_LINK_FLAGS: ${Z3_DEPENDENT_EXTRA_C_LINK_FLA
|
|||
################################################################################
|
||||
# Z3 installation locations
|
||||
################################################################################
|
||||
set (Z3_INSTALL_LIB_DIR "lib")
|
||||
set (Z3_INSTALL_BIN_DIR "bin")
|
||||
set (Z3_INSTALL_INCLUDE_DIR "include")
|
||||
include(GNUInstallDirs)
|
||||
message(STATUS "CMAKE_INSTALL_LIBDIR: \"${CMAKE_INSTALL_LIBDIR}\"")
|
||||
message(STATUS "CMAKE_INSTALL_BINDIR: \"${CMAKE_INSTALL_BINDIR}\"")
|
||||
message(STATUS "CMAKE_INSTALL_INCLUDEDIR: \"${CMAKE_INSTALL_INCLUDEDIR}\"")
|
||||
|
||||
################################################################################
|
||||
# CMake build file locations
|
||||
|
|
|
@ -261,7 +261,10 @@ when invoking CMake and instead set the build type within Visual Studio itself.
|
|||
The following useful options can be passed to CMake whilst configuring.
|
||||
|
||||
* ``CMAKE_BUILD_TYPE`` - STRING. The build type to use. Only relevant for single configuration generators (e.g. "Unix Makefile" and "Ninja").
|
||||
* ``CMAKE_INSTALL_PREFIX`` - STRING. The install prefix to use (e.g. ``/usr/local/``)
|
||||
* ``CMAKE_INSTALL_BINDIR`` - STRING. The path to install z3 binaries (relative to ``CMAKE_INSTALL_PREFIX``), e.g. ``bin``.
|
||||
* ``CMAKE_INSTALL_INCLUDEDIR`` - STRING. The path to install z3 include files (relative to ``CMAKE_INSTALL_PREFIX``), e.g. ``include``.
|
||||
* ``CMAKE_INSTALL_LIBDIR`` - STRING. The path to install z3 libraries (relative to ``CMAKE_INSTALL_PREFIX``), e.g. ``lib``.
|
||||
* ``CMAKE_INSTALL_PREFIX`` - STRING. The install prefix to use (e.g. ``/usr/local/``).
|
||||
* ``ENABLE_TRACING`` - BOOL. If set to ``TRUE`` enable tracing, if set to ``FALSE`` disable tracing.
|
||||
* ``BUILD_LIBZ3_SHARED`` - BOOL. If set to ``TRUE`` build libz3 as a shared library otherwise build as a static library.
|
||||
* ``ENABLE_EXAMPLE_TARGETS`` - BOOL. If set to ``TRUE`` add the build targets for building the API examples.
|
||||
|
@ -322,8 +325,9 @@ in order to be sure that the copied CMake files are not out of date.
|
|||
|
||||
### Install/Uninstall
|
||||
|
||||
Install and uninstall targets are supported. Use ``CMAKE_INSTALL_PREFIX`` to set the install
|
||||
prefix.
|
||||
Install and uninstall targets are supported. Use ``CMAKE_INSTALL_PREFIX`` to
|
||||
set the install prefix. If you also need need to control which directories are
|
||||
used for install set the documented ``CMAKE_INSTALL_*`` options.
|
||||
|
||||
To install run
|
||||
|
||||
|
|
|
@ -165,9 +165,9 @@ foreach (header ${libz3_public_headers})
|
|||
endforeach()
|
||||
|
||||
install(TARGETS libz3
|
||||
LIBRARY DESTINATION "${Z3_INSTALL_LIB_DIR}"
|
||||
ARCHIVE DESTINATION "${Z3_INSTALL_LIB_DIR}"
|
||||
PUBLIC_HEADER DESTINATION "${Z3_INSTALL_INCLUDE_DIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
|
|
@ -43,5 +43,5 @@ target_link_libraries(shell PRIVATE ${Z3_DEPENDENT_LIBS})
|
|||
z3_add_component_dependencies_to_target(shell ${shell_expanded_deps})
|
||||
z3_append_linker_flag_list_to_target(shell ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
|
||||
install(TARGETS shell
|
||||
RUNTIME DESTINATION "${Z3_INSTALL_BIN_DIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue