diff --git a/CMakeLists.txt b/CMakeLists.txt index 4881ebf2d..bfbc6ea0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,16 +57,16 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") ################################################################################ include(${PROJECT_SOURCE_DIR}/cmake/git_utils.cmake) macro(disable_git_describe) - message(WARNING "Disabling INCLUDE_GIT_DESCRIBE") - set(INCLUDE_GIT_DESCRIBE OFF CACHE BOOL "Include git describe output in version output" FORCE) + message(WARNING "Disabling Z3_INCLUDE_GIT_DESCRIBE") + set(Z3_INCLUDE_GIT_DESCRIBE OFF CACHE BOOL "Include git describe output in version output" FORCE) endmacro() macro(disable_git_hash) - message(WARNING "Disabling INCLUDE_GIT_HASH") - set(INCLUDE_GIT_HASH OFF CACHE BOOL "Include git hash in version output" FORCE) + message(WARNING "Disabling Z3_INCLUDE_GIT_HASH") + set(Z3_INCLUDE_GIT_HASH OFF CACHE BOOL "Include git hash in version output" FORCE) unset(Z3GITHASH) # Used in configure_file() endmacro() -option(INCLUDE_GIT_HASH "Include git hash in version output" ON) -option(INCLUDE_GIT_DESCRIBE "Include git describe output in version output" ON) +option(Z3_INCLUDE_GIT_HASH "Include git hash in version output" ON) +option(Z3_INCLUDE_GIT_DESCRIBE "Include git describe output in version output" ON) set(GIT_DIR "${PROJECT_SOURCE_DIR}/.git") if (EXISTS "${GIT_DIR}") @@ -74,7 +74,7 @@ if (EXISTS "${GIT_DIR}") # a re-configure is triggered when the HEAD changes. add_git_dir_dependency("${PROJECT_SOURCE_DIR}" ADD_GIT_DEP_SUCCESS) if (ADD_GIT_DEP_SUCCESS) - if (INCLUDE_GIT_HASH) + if (Z3_INCLUDE_GIT_HASH) get_git_head_hash("${GIT_DIR}" Z3GITHASH) if (NOT Z3GITHASH) message(WARNING "Failed to get Git hash") @@ -87,7 +87,7 @@ if (EXISTS "${GIT_DIR}") message(STATUS "Not using Git hash in version output") unset(Z3GITHASH) # Used in configure_file() endif() - if (INCLUDE_GIT_DESCRIBE) + if (Z3_INCLUDE_GIT_DESCRIBE) get_git_head_describe("${GIT_DIR}" Z3_GIT_DESCRIPTION) if (NOT Z3_GIT_DESCRIPTION) message(WARNING "Failed to get Git description") @@ -267,7 +267,7 @@ if (Z3_API_LOG_SYNC) list(APPEND Z3_COMPONENT_CXX_DEFINES "-DZ3_LOG_SYNC") message(STATUS "Using Z3_API_LOG_SYNC") else() - message(STATUS "Not using API_LOG_SYNC") + message(STATUS "Not using Z3_API_LOG_SYNC") endif() ################################################################################ @@ -361,8 +361,8 @@ endif() ################################################################################ # Tracing ################################################################################ -option(ENABLE_TRACING_FOR_NON_DEBUG "Enable tracing in non-debug builds." OFF) -if (ENABLE_TRACING_FOR_NON_DEBUG) +option(Z3_ENABLE_TRACING_FOR_NON_DEBUG "Enable tracing in non-debug builds." OFF) +if (Z3_ENABLE_TRACING_FOR_NON_DEBUG) list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_TRACE") else() # Tracing is always enabled in debug builds @@ -613,16 +613,16 @@ install( ################################################################################ # Examples ################################################################################ -option(ENABLE_EXAMPLE_TARGETS "Build Z3 api examples" ON) -if (ENABLE_EXAMPLE_TARGETS) +option(Z3_ENABLE_EXAMPLE_TARGETS "Build Z3 api examples" ON) +if (Z3_ENABLE_EXAMPLE_TARGETS) add_subdirectory(examples) endif() ################################################################################ # Documentation ################################################################################ -option(BUILD_DOCUMENTATION "Build API documentation" OFF) -if (BUILD_DOCUMENTATION) +option(Z3_BUILD_DOCUMENTATION "Build API documentation" OFF) +if (Z3_BUILD_DOCUMENTATION) message(STATUS "Building documentation enabled") add_subdirectory(doc) else() diff --git a/README-CMake.md b/README-CMake.md index 2b85eb67e..45357fda1 100644 --- a/README-CMake.md +++ b/README-CMake.md @@ -241,9 +241,9 @@ The following useful options can be passed to CMake whilst configuring. * ``CMAKE_INSTALL_PYTHON_PKG_DIR`` - STRING. The path to install the z3 python bindings. This can be relative (to ``CMAKE_INSTALL_PREFIX``) or absolute. * ``CMAKE_INSTALL_Z3_CMAKE_PACKAGE_DIR`` - STRING. The path to install CMake package files (e.g. ``/usr/lib/cmake/z3``). * ``CMAKE_INSTALL_API_BINDINGS_DOC`` - STRING. The path to install documentation for API bindings. -* ``ENABLE_TRACING_FOR_NON_DEBUG`` - BOOL. If set to ``TRUE`` enable tracing in non-debug builds, if set to ``FALSE`` disable tracing in non-debug builds. Note in debug builds tracing is always enabled. +* ``Z3_ENABLE_TRACING_FOR_NON_DEBUG`` - BOOL. If set to ``TRUE`` enable tracing in non-debug builds, if set to ``FALSE`` disable tracing in non-debug builds. Note in debug builds tracing is always enabled. * ``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. +* ``Z3_ENABLE_EXAMPLE_TARGETS`` - BOOL. If set to ``TRUE`` add the build targets for building the API examples. * ``USE_LIB_GMP`` - BOOL. If set to ``TRUE`` use the GNU multiple precision library. If set to ``FALSE`` use an internal implementation. * ``PYTHON_EXECUTABLE`` - STRING. The python executable to use during the build. * ``BUILD_PYTHON_BINDINGS`` - BOOL. If set to ``TRUE`` then Z3's python bindings will be built. @@ -256,10 +256,10 @@ The following useful options can be passed to CMake whilst configuring. * ``INSTALL_JAVA_BINDINGS`` - BOOL. If set to ``TRUE`` and ``BUILD_JAVA_BINDINGS`` is ``TRUE`` then running the ``install`` target will install Z3's Java bindings. * ``Z3_JAVA_JAR_INSTALLDIR`` - STRING. The path to directory to install the Z3 Java ``.jar`` file. This path should be relative to ``CMAKE_INSTALL_PREFIX``. * ``Z3_JAVA_JNI_LIB_INSTALLDIRR`` - STRING. The path to directory to install the Z3 Java JNI bridge library. This path should be relative to ``CMAKE_INSTALL_PREFIX``. -* ``INCLUDE_GIT_DESCRIBE`` - BOOL. If set to ``TRUE`` and the source tree of Z3 is a git repository then the output of ``git describe`` will be included in the build. -* ``INCLUDE_GIT_HASH`` - BOOL. If set to ``TRUE`` and the source tree of Z3 is a git repository then the git hash will be included in the build. -* ``BUILD_DOCUMENTATION`` - BOOL. If set to ``TRUE`` then documentation for the API bindings can be built by invoking the ``api_docs`` target. -* ``INSTALL_API_BINDINGS_DOCUMENTATION`` - BOOL. If set to ``TRUE`` and ``BUILD_DOCUMENTATION` is ``TRUE`` then documentation for API bindings will be installed +* ``Z3_INCLUDE_GIT_DESCRIBE`` - BOOL. If set to ``TRUE`` and the source tree of Z3 is a git repository then the output of ``git describe`` will be included in the build. +* ``Z3_INCLUDE_GIT_HASH`` - BOOL. If set to ``TRUE`` and the source tree of Z3 is a git repository then the git hash will be included in the build. +* ``Z3_BUILD_DOCUMENTATION`` - BOOL. If set to ``TRUE`` then documentation for the API bindings can be built by invoking the ``api_docs`` target. +* ``Z3_INSTALL_API_BINDINGS_DOCUMENTATION`` - BOOL. If set to ``TRUE`` and ``Z3_BUILD_DOCUMENTATION` is ``TRUE`` then documentation for API bindings will be installed when running the ``install`` target. * ``ALWAYS_BUILD_DOCS`` - BOOL. If set to ``TRUE`` and ``BUILD_DOCUMENTATION`` is ``TRUE`` then documentation for API bindings will always be built. Disabling this is useful for faster incremental builds. The documentation can be manually built by invoking the ``api_docs`` target. diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index d5778add9..fdb0bf8e1 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -78,14 +78,14 @@ set_property(DIRECTORY APPEND PROPERTY "${DOC_DEST_DIR}" ) -option(INSTALL_API_BINDINGS_DOCUMENTATION "Install documentation for API bindings" ON) +option(Z3_INSTALL_API_BINDINGS_DOCUMENTATION "Install documentation for API bindings" ON) set(CMAKE_INSTALL_API_BINDINGS_DOC "${CMAKE_INSTALL_DOCDIR}" CACHE PATH "Path to install documentation for API bindings" ) -if (INSTALL_API_BINDINGS_DOCUMENTATION) +if (Z3_INSTALL_API_BINDINGS_DOCUMENTATION) install( DIRECTORY "${DOC_DEST_DIR}" DESTINATION "${CMAKE_INSTALL_API_BINDINGS_DOC}"