X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=CMakeConfig.txt;h=710f4cd0bf3ba4fd98f2671cb7c252d1bd2063b9;hb=97bfd7a85e905ac543ced91dffaadda3c04dbc5a;hp=707ff4bbedd470bab7af83b227645a54552fba7a;hpb=c3526f7547e7a69204a25982f6764afdab663252;p=awesomized%2Flibmemcached diff --git a/CMakeConfig.txt b/CMakeConfig.txt index 707ff4bb..710f4cd0 100644 --- a/CMakeConfig.txt +++ b/CMakeConfig.txt @@ -1,14 +1,29 @@ -set(CMAKE_BUILD_TYPE Release - CACHE STRING "build type (Release, Debug, ...)") + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + if(NOT DEFINED ENV{CMAKE_BUILD_TYPE}) + set(ENV{CMAKE_BUILD_TYPE} Release) + endif() + set(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE} + CACHE STRING "build type (Release, Debug, ...)" FORCE) +endif() set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "install prefix") +if(APPLE) + set(CMAKE_INSTALL_RPATH @loader_path + CACHE STRING "set relative rpath") +elseif(UNIX) + # FIXME + set(CMAKE_INSTALL_RPATH $ORIGIN + CACHE STRING "set relative rpath") +endif() + option(BUILD_TESTING "whether to enable build of the test suite" - OFF) + $ENV{BUILD_TESTING}) option(BUILD_DOCSONLY "build *only* documentation" - OFF) + $ENV{BUILD_DOCSONLY}) option(BUILD_DOCS "build documentation" - OFF) + ${BUILD_DOCSONLY}) option(BUILD_DOCS_HTML "build HTML docs" ${BUILD_DOCS}) option(BUILD_DOCS_MAN "build manpages" @@ -17,24 +32,29 @@ option(BUILD_DOCS_MANGZ "gzip manpages" ${BUILD_DOCS_MAN}) option(ENABLE_DTRACE "enable dtrace support" - OFF) + $ENV{ENABLE_DTRACE}) option(ENABLE_HASH_FNV64 "enable fnv64 hash support" ON) option(ENABLE_HASH_MURMUR "enable murmur hash support" ON) option(ENABLE_HASH_HSIEH "enable hsieh hash support" - OFF) + $ENV{ENABLE_HASH_HSIEH}) option(ENABLE_MEMASLAP "enable memaslap client" ON) option(ENABLE_SASL "enable SASL support" - OFF) + $ENV{ENABLE_SASL}) -set(ENABLE_SANITIZERS "" +set(ENABLE_SANITIZERS "$ENV{ENABLE_SANITIZERS}" CACHE STRING "sanitizers to enable (e.g. address undefined ...)") if(BUILD_TESTING) - set(MEMCACHED_BINARY "/usr/bin/memcached" - CACHE FILEPATH "memcached binary") + set(MEMCACHED_BINARY "$ENV{MEMCACHED_BINARY}" + CACHE STRING "memcached binary") + set(CMAKE_CTEST_ARGUMENTS "--output-on-failure") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + # available since CMake 3.17 + list(APPEND CMAKE_CTEST_ARGUMENTS -j2 --repeat until-pass:2) + endif() endif() if(BUILD_DOCS) @@ -42,7 +62,7 @@ if(BUILD_DOCS) CACHE STRING "additional sphinx-build command line options") set(SPHINX_THEME "sphinx_rtd_theme" CACHE STRING "sphinx HTML theme") - set(SPHINX_THEME_OPTIONS "'collapse_navigation':False, 'navigation_depth':2, 'titles_only':False, 'includehidden':False" + set(SPHINX_THEME_OPTIONS "" CACHE STRING "sphinx HTML theme options") set(SPHINX_EXTENSIONS "" CACHE STRING "comma separated list of quoted sphinx extensions")