-set(THREADS_PREFER_PTHREAD_FLAG ON)
# globals
-include(CTest)
+if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+ include(CTest)
+endif()
include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
find_package(PkgConfig)
+set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# locals
include(CheckDecl)
include(CheckDependency)
include(CheckHeader)
+include(CheckCompiles)
include(CheckType)
include(CheckStdatomic)
## dtrace
if(ENABLE_DTRACE)
- set(HAVE_DTRACE 1)
+ find_package(DTrace)
+ if(DTRACE_EXECUTABLE)
+ set(HAVE_DTRACE 1)
+ else()
+ message(WARNING "The dtrace command is required to enable dtrace/systemtap support.")
+ endif()
endif()
-##uuid
+## uuid
if(BUILD_TESTING)
check_dependency(LIBUUID uuid uuid/uuid.h)
endif()
endif()
## hashes
-if(ENABLE_FNV64_HASH)
+if(ENABLE_HASH_FNV64)
set(HAVE_FNV64_HASH 1)
endif()
-if(ENABLE_MURMUR_HASH)
+if(ENABLE_HASH_MURMUR)
set(HAVE_MURMUR_HASH 1)
endif()
-if(ENABLE_HSIEH_HASH)
+if(ENABLE_HASH_HSIEH)
set(HAVE_HSIEH_HASH 1)
endif()
check_decl(MSG_NOSIGNAL sys/socket.h)
check_decl(rcvtimeo sys/socket.h)
check_decl(sndtimeo sys/socket.h)
-check_decl(strerror_r string.h)
+check_decl(setenv stdlib.h)
check_decl(strerror string.h)
+check_decl(strerror_r string.h)
+check_compiles(HAVE_STRERROR_R_CHAR_P "char x, y = *strerror_r(0,&x,1);" string.h)
check_decl(abi::__cxa_demangle cxxabi.h)
set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE})