From 5fb950f50d691dfc3b8a5c5b61c3260a2bb1ec69 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 4 Nov 2020 15:57:58 +0100 Subject: [PATCH] cmake: honor env --- CMakeConfig.txt | 30 +++++++++++++++++++----------- CMakeLists.txt | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/CMakeConfig.txt b/CMakeConfig.txt index 8f764d3c..3c44a776 100644 --- a/CMakeConfig.txt +++ b/CMakeConfig.txt @@ -14,7 +14,7 @@ if(APPLE) CACHE STRING "set relative rpath") elseif(UNIX) # FIXME - set(CMAKE_INSTALL_RPATH $ORIGIN + set(CMAKE_INSTALL_RPATH "\$ORIGIN" CACHE STRING "set relative rpath") endif() @@ -31,21 +31,29 @@ option(BUILD_DOCS_MAN "build manpages" option(BUILD_DOCS_MANGZ "gzip manpages" ${BUILD_DOCS_MAN}) +set(ENABLE_SANITIZERS "$ENV{ENABLE_SANITIZERS}" + CACHE STRING "sanitizers to enable (e.g. address undefined ...)") +option(ENABLE_SASL "enable SASL support" + $ENV{ENABLE_SASL}) option(ENABLE_DTRACE "enable dtrace support" $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" $ENV{ENABLE_HASH_HSIEH}) +if(NOT DEFINED ENV{ENABLE_HASH_FNV64}) + set(ENV{ENABLE_HASH_FNV64} ON) +endif() +option(ENABLE_HASH_FNV64 "enable fnv64 hash support" + $ENV{ENABLE_HASH_FNV64}) +if(NOT DEFINED ENV{ENABLE_HASH_MURMUR}) + set(ENV{ENABLE_HASH_MURMUR} ON) +endif() +option(ENABLE_HASH_MURMUR "enable murmur hash support" + $ENV{ENABLE_HASH_MURMUR}) +if(NOT DEFINED ENV{ENABLE_MEMASLAP}) + set(ENV{ENABLE_MEMASLAP} ON) +endif() option(ENABLE_MEMASLAP "enable memaslap client" - ON) -option(ENABLE_SASL "enable SASL support" - $ENV{ENABLE_SASL}) - -set(ENABLE_SANITIZERS "$ENV{ENABLE_SANITIZERS}" - CACHE STRING "sanitizers to enable (e.g. address undefined ...)") + $ENV{ENABLE_MEMASLAP}) if(BUILD_TESTING) set(MEMCACHED_BINARY "$ENV{MEMCACHED_BINARY}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 18278f63..19755ffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ if(NOT BUILD_DOCSONLY) memtouch ) - add_subdirectory(include) add_subdirectory(src) + add_subdirectory(include) add_subdirectory(support) add_subdirectory(test) -- 2.30.2