2 # Libevent CMake project
4 # Based on initial work by:
18 # cmake -G "Visual Studio 10" ..
22 cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
25 cmake_policy(SET CMP0054 NEW)
28 cmake_policy(SET CMP0074 NEW)
31 cmake_policy(SET CMP0075 NEW)
34 if(NOT CMAKE_BUILD_TYPE)
35 set(CMAKE_BUILD_TYPE Release
36 CACHE STRING "Set build type to Debug o Release (default Release)" FORCE)
38 string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
40 # get rid of the extra default configurations
41 # what? why would you get id of other useful build types? - Ellzey
42 set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited configurations" FORCE)
44 set(EVENT__LIBRARY_TYPE DEFAULT CACHE STRING
45 "Set library type to SHARED/STATIC/BOTH (default SHARED for MSVC, otherwise BOTH)")
49 list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
50 string(REGEX MATCH "SunOS" SOLARIS "${CMAKE_SYSTEM_NAME}")
53 include(CheckTypeSize)
54 include(CheckFileOffsetBits)
56 include(CheckVariableExists)
57 include(CheckSymbolExists)
58 include(CheckStructHasMember)
59 include(CheckCSourceCompiles)
60 include(CheckPrototypeDefinition)
61 include(CheckFunctionKeywords)
62 include(CheckConstExists)
63 include(AddCompilerFlags)
64 include(VersionViaGit)
66 event_fuzzy_version_from_git()
68 set(EVENT_VERSION_MAJOR ${EVENT_GIT___VERSION_MAJOR})
69 set(EVENT_VERSION_MINOR ${EVENT_GIT___VERSION_MINOR})
70 set(EVENT_VERSION_PATCH ${EVENT_GIT___VERSION_PATCH})
71 set(EVENT_VERSION_STAGE ${EVENT_GIT___VERSION_STAGE})
74 set(EVENT_ABI_MAJOR ${EVENT_VERSION_MAJOR})
75 set(EVENT_ABI_MINOR ${EVENT_VERSION_MINOR})
76 set(EVENT_ABI_PATCH ${EVENT_VERSION_PATCH})
78 set(EVENT_ABI_LIBVERSION
79 "${EVENT_ABI_MAJOR}.${EVENT_ABI_MINOR}.${EVENT_ABI_PATCH}")
81 set(EVENT_PACKAGE_VERSION
82 "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}")
84 set(EVENT_NUMERIC_VERSION 0x02010c00)
85 # equals to VERSION_INFO in Makefile.am
86 set(EVENT_ABI_LIBVERSION_CURRENT 7)
87 set(EVENT_ABI_LIBVERSION_REVISION 1)
88 set(EVENT_ABI_LIBVERSION_AGE 0)
90 # equals to RELEASE in Makefile.am
91 set(EVENT_PACKAGE_RELEASE 2.1)
93 # only a subset of names can be used, defaults to "beta"
94 set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE})
96 # a list that defines what can set for EVENT_STAGE_VERSION
97 set(EVENT__ALLOWED_STAGE_NAMES
106 FIND EVENT__ALLOWED_STAGE_NAMES
107 "${EVENT_STAGE_NAME}"
110 if (EVENT__STAGE_RET EQUAL -1)
112 "stage ${EVENT_STAGE_NAME} is not allowed, reset to beta")
113 set(EVENT_STAGE_NAME beta)
117 "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}-${EVENT_STAGE_NAME}")
119 option(EVENT__DISABLE_DEBUG_MODE
120 "Define if libevent should build without support for a debug mode" OFF)
122 option(EVENT__ENABLE_VERBOSE_DEBUG
123 "Enables verbose debugging" OFF)
125 option(EVENT__DISABLE_MM_REPLACEMENT
126 "Define if libevent should not allow replacing the mm functions" OFF)
128 option(EVENT__DISABLE_THREAD_SUPPORT
129 "Define if libevent should not be compiled with thread support" OFF)
131 option(EVENT__DISABLE_OPENSSL
132 "Define if libevent should build without support for OpenSSL encryption" OFF)
134 option(EVENT__DISABLE_BENCHMARK
135 "Defines if libevent should build without the benchmark executables" OFF)
137 option(EVENT__DISABLE_TESTS
138 "If tests should be compiled or not" OFF)
140 option(EVENT__DISABLE_REGRESS
141 "Disable the regress tests" OFF)
143 option(EVENT__DISABLE_SAMPLES
144 "Disable sample files" OFF)
146 option(EVENT__DISABLE_CLOCK_GETTIME
147 "Do not use clock_gettime even if it is available" OFF)
149 option(EVENT__FORCE_KQUEUE_CHECK
150 "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF)
152 # TODO: Add --disable-largefile omit support for large files
153 option(EVENT__COVERAGE
154 "Enable running gcov to get a test coverage report (only works with GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well." OFF)
156 # Put the libaries and binaries that get built into directories at the
157 # top of the build tree rather than in hard-to-find leaf directories.
159 # But only if this variables are not defined yet
160 # (i.e. libevent is used via add_subdirectory())
161 if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
162 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
164 if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
165 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
167 if (NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
168 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
171 if (EVENT__ENABLE_VERBOSE_DEBUG)
172 add_definitions(-DUSE_DEBUG=1)
175 # make it colorful under ninja-build
176 if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
177 add_compiler_flags(-fdiagnostics-color=always)
180 # Setup compiler flags for coverage.
182 if (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "debug")
183 message(FATAL_ERROR "Coverage requires -DCMAKE_BUILD_TYPE=Debug")
186 message(STATUS "Setting coverage compiler flags")
188 set(CMAKE_REQUIRED_LIBRARIES "--coverage")
189 add_compiler_flags(-g -O0 --coverage)
190 set(CMAKE_REQUIRED_LIBRARIES "")
196 if (("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR
197 ("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang"))
200 if (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR (${CLANG}))
203 if (("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") OR (${CLANG}))
207 # Detect library type
208 set(EVENT_LIBRARY_TYPE)
209 if ("${EVENT__LIBRARY_TYPE}" STREQUAL "DEFAULT")
211 set(EVENT_LIBRARY_TYPE SHARED)
213 set(EVENT_LIBRARY_TYPE BOTH)
216 string(TOUPPER "${EVENT__LIBRARY_TYPE}" EVENT_LIBRARY_TYPE)
218 if ((${MSVC}) AND ("${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH"))
220 "Building SHARED and STATIC is not supported for MSVC "
221 "(due to conflicts in library name"
222 " between STATIC library and IMPORTED library for SHARED libraries)")
224 set(EVENT_LIBRARY_STATIC OFF)
225 set(EVENT_LIBRARY_SHARED OFF)
226 if ("${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH")
227 set(EVENT_LIBRARY_STATIC ON)
228 set(EVENT_LIBRARY_SHARED ON)
229 elseif ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC")
230 set(EVENT_LIBRARY_STATIC ON)
231 elseif ("${EVENT_LIBRARY_TYPE}" STREQUAL "SHARED")
232 set(EVENT_LIBRARY_SHARED ON)
234 message(FATAL_ERROR "${EVENT_LIBRARY_TYPE} is not supported")
238 set(msvc_static_runtime OFF)
239 if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC")
240 set(msvc_static_runtime ON)
244 # - https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2017
245 # - https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
246 option(EVENT__MSVC_STATIC_RUNTIME
247 "Link static runtime libraries"
248 ${msvc_static_runtime})
250 if (EVENT__MSVC_STATIC_RUNTIME)
253 CMAKE_C_FLAGS_RELEASE
254 CMAKE_C_FLAGS_MINSIZEREL
255 CMAKE_C_FLAGS_RELWITHDEBINFO
257 if (${flag_var} MATCHES "/MD")
258 string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
264 # GNUC specific options.
266 option(EVENT__DISABLE_GCC_WARNINGS "Disable verbose warnings with GCC" OFF)
267 option(EVENT__ENABLE_GCC_HARDENING "Enable compiler security checks" OFF)
268 option(EVENT__ENABLE_GCC_FUNCTION_SECTIONS "Enable gcc function sections" OFF)
269 option(EVENT__ENABLE_GCC_WARNINGS "Make all GCC warnings into errors" OFF)
271 set(GCC_V ${CMAKE_C_COMPILER_VERSION})
274 -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing -Wstrict-prototypes
276 -fno-strict-aliasing # gcc 2.9.5+
281 -Wmissing-field-initializers
282 -Wdeclaration-after-statement
296 list(APPEND __FLAGS -Wno-unused-function)
299 if (EVENT__DISABLE_GCC_WARNINGS)
300 list(APPEND __FLAGS -w)
303 if (EVENT__ENABLE_GCC_HARDENING)
305 -fstack-protector-all
309 "--param ssp-buffer-size=1")
311 add_definitions(-D_FORTIFY_SOURCE=2)
314 if (EVENT__ENABLE_GCC_FUNCTION_SECTIONS)
315 list(APPEND __FLAGS -ffunction-sections)
316 # TODO: Add --gc-sections support. We need some checks for NetBSD to ensure this works.
319 if (EVENT__ENABLE_GCC_WARNINGS)
320 list(APPEND __FLAGS -Werror)
323 add_compiler_flags(${__FLAGS})
327 # Get rid of deprecated warnings for OpenSSL on OSX 10.7 and greater.
329 -Wno-error=deprecated-declarations
340 set(CMAKE_REQUIRED_LIBRARIES ws2_32 shell32 advapi32)
341 set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h -D_WIN32_WINNT=0x0600)
344 set(CMAKE_REQUIRED_LIBRARIES socket nsl)
347 # Check if _GNU_SOURCE is available.
348 if (NOT DEFINED _GNU_SOURCE)
349 CHECK_SYMBOL_EXISTS(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
352 unset(_GNU_SOURCE CACHE)
353 CHECK_SYMBOL_EXISTS(_GNU_SOURCE "features.h" _GNU_SOURCE)
357 set(_GNU_SOURCE TRUE)
362 add_definitions(-D_GNU_SOURCE=1)
363 set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
366 # Check if header files exist
367 list(APPEND FILES_TO_CHECK
386 list(APPEND FILES_TO_CHECK
393 list(APPEND FILES_TO_CHECK
422 if (NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
423 list(APPEND FILES_TO_CHECK sys/sysctl.h)
427 list(APPEND FILES_TO_CHECK
433 foreach(FILE ${FILES_TO_CHECK})
434 CHECK_INCLUDE_FILE_CONCAT(${FILE} "EVENT")
436 unset(FILES_TO_CHECK)
438 # Check if functions exist
439 list(APPEND SYMBOLS_TO_CHECK
463 if (NOT EVENT__DISABLE_CLOCK_GETTIME)
464 list(APPEND SYMBOLS_TO_CHECK clock_gettime)
468 list(APPEND SYMBOLS_TO_CHECK
473 list(APPEND SYMBOLS_TO_CHECK
507 list(APPEND SYMBOLS_TO_CHECK mach_absolute_time)
511 # Add stdio.h for vasprintf
512 set(EVENT_INCLUDES ${EVENT_INCLUDES} stdio.h)
513 CHECK_SYMBOLS_EXIST("${SYMBOLS_TO_CHECK}" "${EVENT_INCLUDES}" "EVENT")
514 unset(SYMBOLS_TO_CHECK)
515 set(EVENT__HAVE_EPOLL ${EVENT__HAVE_EPOLL_CREATE})
517 # Get the gethostbyname_r prototype.
518 if(EVENT__HAVE_GETHOSTBYNAME_R)
519 CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
520 "int gethostbyname_r(const char *name, struct hostent *hp, struct hostent_data *hdata)"
523 EVENT__HAVE_GETHOSTBYNAME_R_3_ARG)
525 CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
526 "struct hostent *gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, int *herr)"
529 EVENT__HAVE_GETHOSTBYNAME_R_5_ARG)
531 CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
532 "int gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, struct hostent **result, int *herr)"
535 EVENT__HAVE_GETHOSTBYNAME_R_6_ARG)
538 if(HAVE_PORT_H AND HAVE_PORT_CREATE)
539 set(EVENT__HAVE_EVENT_PORTS 1)
542 # Only `CHECK_TYPE_SIZE()' will use `CMAKE_EXTRA_INCLUDE_FILES'
543 set(CMAKE_EXTRA_INCLUDE_FILES ${EVENT_INCLUDES})
545 CHECK_TYPE_SIZE("struct sockaddr_un" EVENT__HAVE_STRUCT_SOCKADDR_UN)
546 CHECK_TYPE_SIZE("uint8_t" EVENT__HAVE_UINT8_T)
547 CHECK_TYPE_SIZE("uint16_t" EVENT__HAVE_UINT16_T)
548 CHECK_TYPE_SIZE("uint32_t" EVENT__HAVE_UINT32_T)
549 CHECK_TYPE_SIZE("uint64_t" EVENT__HAVE_UINT64_T)
550 CHECK_TYPE_SIZE("short" EVENT__SIZEOF_SHORT BUILTIN_TYPES_ONLY)
551 CHECK_TYPE_SIZE("int" EVENT__SIZEOF_INT BUILTIN_TYPES_ONLY)
552 CHECK_TYPE_SIZE("unsigned" EVENT__SIZEOF_UNSIGNED BUILTIN_TYPES_ONLY)
553 CHECK_TYPE_SIZE("unsigned int" EVENT__SIZEOF_UNSIGNED_INT BUILTIN_TYPES_ONLY)
554 CHECK_TYPE_SIZE("long" EVENT__SIZEOF_LONG BUILTIN_TYPES_ONLY)
555 CHECK_TYPE_SIZE("long long" EVENT__SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY)
558 # These aren't available until Windows Vista.
559 # But you can still link them. They just won't be found when running the exe.
560 set(EVENT__HAVE_INET_NTOP 0)
561 set(EVENT__HAVE_INET_PTON 0)
564 # Check for different inline keyword versions.
565 check_function_keywords("inline" "__inline" "__inline__")
568 set(EVENT__inline inline)
569 elseif (HAVE___INLINE)
570 set(EVENT__inline __inline)
571 elseif(HAVE___INLINE__)
572 set(EVENT__inline __inline__)
577 # __func__/__FUNCTION__ is not a macros in general
578 CHECK_SYMBOL_EXISTS("__func__" "" EVENT__HAVE___func__)
579 CHECK_SYMBOL_EXISTS("__FUNCTION__" "" EVENT__HAVE___FUNCTION__)
581 CHECK_SYMBOL_EXISTS(TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH)
582 CHECK_CONST_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN)
583 CHECK_CONST_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND)
584 CHECK_SYMBOL_EXISTS(F_SETFD fcntl.h EVENT__HAVE_SETFD)
586 CHECK_TYPE_SIZE(fd_mask EVENT__HAVE_FD_MASK)
588 CHECK_TYPE_SIZE(size_t EVENT__SIZEOF_SIZE_T)
589 if(NOT EVENT__SIZEOF_SIZE_T)
590 set(EVENT__size_t "unsigned")
591 set(EVENT__SIZEOF_SIZE_T ${EVENT__SIZEOF_UNSIGNED})
593 set(EVENT__size_t size_t)
596 CHECK_TYPE_SIZE("off_t" EVENT__SIZEOF_OFF_T LANGUAGE C)
599 # XXX we should functionalize these size and type sets. --elley
603 list(APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h)
605 CHECK_TYPE_SIZE("ssize_t" EVENT__SIZEOF_SSIZE_T_LOWER LANGUAGE C)
606 CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C)
608 if (EVENT__SIZEOF_SSIZE_T_LOWER)
609 set(EVENT__ssize_t "ssize_t")
610 set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_LOWER})
611 elseif (EVENT__SIZEOF_SSIZE_T_UPPER)
612 set(EVENT__ssize_t "SSIZE_T")
613 set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_UPPER})
615 set(EVENT__ssize_t "int")
616 set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
619 CHECK_TYPE_SIZE(socklen_t EVENT__SIZEOF_SOCKLEN_T)
620 if(NOT EVENT__SIZEOF_SOCKLEN_T)
621 set(EVENT__socklen_t "unsigned int")
622 set(EVENT__SIZEOF_SOCKLEN_T ${EVENT__SIZEOF_UNSIGNED_INT})
624 set(EVENT__socklen_t "socklen_t")
627 CHECK_TYPE_SIZE(pid_t EVENT__SIZEOF_PID_T)
628 if(NOT EVENT__SIZEOF_PID_T)
629 set(EVENT__SIZEOF_PID_T ${EVENT__SIZEOF_INT})
631 set(EVENT__SIZEOF_PID_T EVENT__SIZEOF_PID_T)
634 if (NOT EVENT__DISABLE_THREAD_SUPPORT)
636 list(APPEND CMAKE_EXTRA_INCLUDE_FILES pthread.h)
638 CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T)
641 if(EVENT__HAVE_CLOCK_GETTIME)
642 set(EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1)
645 # we're just getting lazy now.
646 CHECK_TYPE_SIZE("uintptr_t" EVENT__HAVE_UINTPTR_T)
647 CHECK_TYPE_SIZE("void *" EVENT__SIZEOF_VOID_P)
648 CHECK_TYPE_SIZE("time_t" EVENT__SIZEOF_TIME_T)
650 # Tests file offset bits.
651 # TODO: Add AIX test for if -D_LARGE_FILES is needed.
653 # XXX: Why is this here? we don't even use it. Well, we don't even use it
654 # on top of that, why is it set in the config.h?! IT_MAKES_NO_SENSE
655 # I'm commenting it out for now.
658 #CHECK_FILE_OFFSET_BITS()
660 # Verify kqueue works with pipes.
661 if (EVENT__HAVE_KQUEUE)
662 if ((CMAKE_CROSSCOMPILING OR APPLE) AND NOT EVENT__FORCE_KQUEUE_CHECK)
663 message(WARNING "Cannot check if kqueue works with pipes when crosscompiling, use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires manually running a test program on the cross compilation target)")
664 set(EVENT__HAVE_WORKING_KQUEUE 1)
666 message(STATUS "Checking if kqueue works with pipes...")
667 include(CheckWorkingKqueue)
671 if(EVENT__HAVE_NETDB_H)
672 list(APPEND CMAKE_EXTRA_INCLUDE_FILES netdb.h)
673 CHECK_TYPE_SIZE("struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO)
675 list(APPEND CMAKE_EXTRA_INCLUDE_FILES ws2tcpip.h)
676 CHECK_TYPE_SIZE("struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO)
679 # Check for sockaddr structure sizes.
680 set(SOCKADDR_HEADERS)
682 set(CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN")
683 if (_MSC_VER LESS 1300)
684 set(SOCKADDR_HEADERS winsock.h)
686 set(SOCKADDR_HEADERS winsock2.h ws2tcpip.h)
689 if (EVENT__HAVE_NETINET_IN_H)
690 set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netinet/in.h)
693 if (EVENT__HAVE_NETINET_IN6_H)
694 set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netinet/in6.h)
697 if (EVENT__HAVE_SYS_SOCKET_H)
698 set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} sys/socket.h)
701 if (EVENT__HAVE_NETDB_H)
702 set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netdb.h)
706 CHECK_TYPE_SIZE("struct in6_addr" EVENT__HAVE_STRUCT_IN6_ADDR)
707 if(EVENT__HAVE_STRUCT_IN6_ADDR)
708 CHECK_STRUCT_HAS_MEMBER("struct in6_addr"
709 s6_addr16 "${SOCKADDR_HEADERS}"
710 EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16)
712 CHECK_STRUCT_HAS_MEMBER("struct in6_addr"
713 s6_addr32 "${SOCKADDR_HEADERS}"
714 EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32)
717 CHECK_TYPE_SIZE("sa_family_t" EVENT__HAVE_SA_FAMILY_T)
718 CHECK_TYPE_SIZE("struct sockaddr_in6" EVENT__HAVE_STRUCT_SOCKADDR_IN6)
720 if(EVENT__HAVE_STRUCT_SOCKADDR_IN6)
721 CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6"
722 sin6_len "${SOCKADDR_HEADERS}"
723 EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN)
725 CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6"
726 sin_len "${SOCKADDR_HEADERS}"
727 EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN)
730 CHECK_TYPE_SIZE("struct sockaddr_storage" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE)
731 if(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE)
732 CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage"
733 ss_family "${SOCKADDR_HEADERS}"
734 EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
736 CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage"
737 __ss_family "${SOCKADDR_HEADERS}" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY)
740 CHECK_TYPE_SIZE("struct linger" EVENT__HAVE_STRUCT_LINGER)
742 # Group the source files.
744 bufferevent-internal.h
745 changelist-internal.h
747 epolltable-internal.h
775 include/event2/buffer.h
776 include/event2/bufferevent.h
777 include/event2/bufferevent_compat.h
778 include/event2/bufferevent_struct.h
779 include/event2/buffer_compat.h
781 include/event2/dns_compat.h
782 include/event2/dns_struct.h
783 include/event2/event.h
784 include/event2/event_compat.h
785 include/event2/event_struct.h
786 include/event2/http.h
787 include/event2/http_compat.h
788 include/event2/http_struct.h
789 include/event2/keyvalq_struct.h
790 include/event2/listener.h
792 include/event2/rpc_compat.h
793 include/event2/rpc_struct.h
795 include/event2/tag_compat.h
796 include/event2/thread.h
797 include/event2/util.h
798 include/event2/visibility.h
799 ${PROJECT_BINARY_DIR}/include/event2/event-config.h)
806 bufferevent_ratelim.c
819 if(EVENT__HAVE_SELECT)
820 list(APPEND SRC_CORE select.c)
824 list(APPEND SRC_CORE poll.c)
827 if(EVENT__HAVE_KQUEUE)
828 list(APPEND SRC_CORE kqueue.c)
831 if(EVENT__HAVE_DEVPOLL)
832 list(APPEND SRC_CORE devpoll.c)
835 if(EVENT__HAVE_EPOLL)
836 list(APPEND SRC_CORE epoll.c)
839 if(EVENT__HAVE_EVENT_PORTS)
840 list(APPEND SRC_CORE evport.c)
843 if (NOT EVENT__DISABLE_OPENSSL)
844 find_package(OpenSSL REQUIRED)
846 set(EVENT__HAVE_OPENSSL 1)
848 message(STATUS "OpenSSL include: ${OPENSSL_INCLUDE_DIR}")
849 message(STATUS "OpenSSL lib: ${OPENSSL_LIBRARIES}")
851 include_directories(${OPENSSL_INCLUDE_DIR})
853 list(APPEND SRC_OPENSSL bufferevent_openssl.c)
854 list(APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h)
855 list(APPEND LIB_APPS ${OPENSSL_LIBRARIES})
858 if (NOT EVENT__DISABLE_THREAD_SUPPORT)
860 list(APPEND SRC_CORE evthread_win32.c)
862 find_package(Threads REQUIRED)
863 if (NOT CMAKE_USE_PTHREADS_INIT)
865 "Failed to find Pthreads, set EVENT__DISABLE_THREAD_SUPPORT to disable")
868 set(EVENT__HAVE_PTHREADS 1)
869 list(APPEND LIB_APPS ${CMAKE_THREAD_LIBS_INIT})
873 if (NOT EVENT__DISABLE_TESTS)
874 # Zlib is only used for testing.
877 if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
878 include_directories(${ZLIB_INCLUDE_DIRS})
880 set(EVENT__HAVE_LIBZ 1)
881 list(APPEND LIB_APPS ${ZLIB_LIBRARIES})
891 add_definitions(-DHAVE_CONFIG_H)
893 # We use BEFORE here so we don't accidentally look in system directories
894 # first for some previous versions of the headers that are installed.
895 include_directories(BEFORE ${PROJECT_SOURCE_DIR}
896 ${PROJECT_SOURCE_DIR}/compat
897 ${PROJECT_SOURCE_DIR}/include)
906 list(APPEND HDR_PRIVATE WIN32-Code/getopt.h)
908 set(EVENT__DNS_USE_FTIME_FOR_ID 1)
909 set(LIB_PLATFORM ws2_32 shell32 advapi32)
911 -D_CRT_SECURE_NO_WARNINGS
912 -D_CRT_NONSTDC_NO_DEPRECATE)
914 include_directories(./WIN32-Code)
918 list(APPEND LIB_PLATFORM socket nsl)
921 source_group("Headers Private" FILES ${HDR_PRIVATE})
922 source_group("Header Compat" FILES ${HDR_COMPAT})
923 source_group("Headers Public" FILES ${HDR_PUBLIC})
924 source_group("Source Core" FILES ${SRC_CORE})
925 source_group("Source Extra" FILES ${SRC_EXTRA})
927 # Generate the configure headers.
928 # (Place them in the build dir so we don't polute the source tree with generated files).
929 include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
932 set(EVENT_SHARED_FLAGS -fvisibility=hidden)
933 elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro")
934 set(EVENT_SHARED_FLAGS -xldscope=hidden)
938 ${CMAKE_CURRENT_SOURCE_DIR}/event-config.h.cmake
939 ${CMAKE_CURRENT_BINARY_DIR}/include/event2/event-config.h
943 ${CMAKE_CURRENT_SOURCE_DIR}/evconfig-private.h.cmake
944 ${CMAKE_CURRENT_BINARY_DIR}/include/evconfig-private.h)
947 # Create the libraries.
949 include(AddEventLibrary)
950 add_event_library(event_core SOURCES ${SRC_CORE})
951 add_event_library(event_extra
952 INNER_LIBRARIES event_core
953 SOURCES ${SRC_EXTRA})
955 if (NOT EVENT__DISABLE_OPENSSL)
956 add_event_library(event_openssl
957 INNER_LIBRARIES event_core
958 OUTER_INCLUDES ${OPENSSL_INCLUDE_DIR}
959 LIBRARIES ${OPENSSL_LIBRARIES}
960 SOURCES ${SRC_OPENSSL})
963 if (EVENT__HAVE_PTHREADS)
964 set(SRC_PTHREADS evthread_pthread.c)
965 add_event_library(event_pthreads
966 INNER_LIBRARIES event_core
967 SOURCES ${SRC_PTHREADS})
970 # library exists for historical reasons; it contains the contents of
971 # both libevent_core and libevent_extra. You shouldn’t use it; it may
972 # go away in a future version of Libevent.
973 add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA})
978 if (${EVENT_LIBRARY_STATIC})
979 list(APPEND _TMPLIBS event_core_static event_static)
981 if (${EVENT_LIBRARY_SHARED})
982 list(APPEND _TMPLIBS event_core_shared event_shared)
984 foreach(lib ${_TMPLIBS})
985 target_link_libraries(${lib} iphlpapi)
989 list(APPEND WIN32_GETOPT
991 WIN32-Code/getopt_long.c)
997 macro(add_sample_prog ssl name)
998 add_executable(${name} ${ARGN})
1000 target_link_libraries(${name}
1007 target_link_libraries(${name} event_openssl)
1009 target_link_libraries(${name} crypt32)
1013 if (NOT EVENT__DISABLE_SAMPLES)
1021 foreach(SAMPLE ${SAMPLES})
1022 add_sample_prog(OFF ${SAMPLE} sample/${SAMPLE}.c)
1025 if (NOT EVENT__DISABLE_OPENSSL)
1026 add_sample_prog(ON https-client
1027 sample/https-client.c
1028 sample/openssl_hostname_validation.c
1030 add_sample_prog(ON le-proxy
1038 foreach (SAMPLE ${SAMPLES_WOPT})
1039 add_sample_prog(OFF ${SAMPLE} sample/${SAMPLE}.c ${WIN32_GETOPT})
1046 macro(add_bench_prog prog)
1047 add_executable(${prog} ${ARGN})
1048 target_link_libraries(${prog}
1054 if (NOT EVENT__DISABLE_BENCHMARK)
1055 foreach (BENCHMARK bench_http bench_httpclient)
1056 add_bench_prog(${BENCHMARK} test/${BENCHMARK}.c)
1059 add_bench_prog(bench test/bench.c ${WIN32_GETOPT})
1060 add_bench_prog(bench_cascade test/bench_cascade.c ${WIN32_GETOPT})
1066 macro(add_test_prog prog)
1067 add_executable(${prog} test/${prog}.c)
1068 target_link_libraries(${prog}
1075 if (NOT EVENT__DISABLE_TESTS)
1077 # Generate Regress tests.
1079 if (NOT EVENT__DISABLE_REGRESS)
1080 # (We require python to generate the regress tests)
1081 find_package(PythonInterp 3)
1083 if (PYTHONINTERP_FOUND)
1084 set(__FOUND_USABLE_PYTHON 1)
1086 find_package(PythonInterp 2)
1087 if (PYTHONINTERP_FOUND)
1088 set(__FOUND_USABLE_PYTHON 1)
1090 message(ERROR "No suitable Python version found, bailing...")
1094 if (__FOUND_USABLE_PYTHON)
1095 message(STATUS "Generating regress tests...")
1097 add_definitions(-DTINYTEST_LOCAL)
1101 ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.c
1102 ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.h
1106 COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py --quiet regress.rpc
1107 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
1109 list(APPEND SRC_REGRESS
1113 test/regress_buffer.c
1114 test/regress_bufferevent.c
1117 test/regress_finalize.c
1119 test/regress_listener.c
1121 test/regress_minheap.c
1123 test/regress_testutils.c
1124 test/regress_testutils.h
1129 list(APPEND SRC_REGRESS test/regress_iocp.c)
1130 if (NOT EVENT__DISABLE_THREAD_SUPPORT)
1131 list(APPEND SRC_REGRESS test/regress_thread.c)
1133 elseif (EVENT__HAVE_PTHREADS)
1134 list(APPEND SRC_REGRESS test/regress_thread.c)
1137 if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
1138 list(APPEND SRC_REGRESS test/regress_zlib.c)
1141 if (NOT EVENT__DISABLE_OPENSSL)
1142 list(APPEND SRC_REGRESS test/regress_ssl.c)
1145 add_executable(regress ${SRC_REGRESS})
1147 target_link_libraries(regress
1152 if (NOT EVENT__DISABLE_OPENSSL)
1153 target_link_libraries(regress event_openssl)
1155 if (CMAKE_USE_PTHREADS_INIT)
1156 target_link_libraries(regress event_pthreads)
1159 message(WARNING "No suitable Python interpreter found, cannot generate regress tests!")
1166 # all of these, including the cmakelists.txt should be moved
1167 # into the dirctory 'tests' first.
1169 # doing this, we can remove all the DISABLE_TESTS stuff, and simply
1170 # do something like:
1172 # add_custom_targets(tests)
1173 # add_executable(... EXCLUDE_FROM_ALL ...c)
1174 # add_dependencis(tests testa testb testc)
1177 # then you can just run 'make tests' instead of them all
1178 # auto-compile|running
1180 set(TESTPROGS test-changelist
1188 foreach (TESTPROG ${TESTPROGS} test-dumpevents)
1189 add_test_prog(${TESTPROG})
1192 add_test_prog(test-ratelim m)
1194 add_test_prog(test-ratelim)
1204 # We run all tests with the different backends turned on one at a time.
1207 # Add event backends based on system introspection result.
1210 if (EVENT__HAVE_EPOLL)
1211 list(APPEND BACKENDS EPOLL)
1214 if (EVENT__HAVE_SELECT)
1215 list(APPEND BACKENDS SELECT)
1218 if (EVENT__HAVE_POLL)
1219 list(APPEND BACKENDS POLL)
1222 if (EVENT__HAVE_KQUEUE)
1223 list(APPEND BACKENDS KQUEUE)
1226 if (EVENT__HAVE_EVENT_PORTS)
1227 list(APPEND BACKENDS EVPORT)
1230 if (EVENT__HAVE_DEVPOLL)
1231 list(APPEND BACKENDS DEVPOLL)
1235 list(APPEND BACKENDS WIN32)
1239 # Default environment variables turns off all event systems,
1240 # then we enable each one, one at a time when creating the tests.
1241 set(DEFAULT_TEST_ENV_VARS)
1242 foreach(BACKEND ${BACKENDS})
1243 set(BACKEND_ENV_VAR "EVENT_NO${BACKEND}=1")
1244 list(APPEND DEFAULT_TEST_ENV_VARS "${BACKEND_ENV_VAR}")
1247 # Macro that creates the ctest test for a backend.
1248 macro(add_backend_test BACKEND_TEST_NAME ENV_VARS)
1251 foreach (TESTPROG ${TESTPROGS})
1252 set(TEST_NAME ${TESTPROG}__${BACKEND_TEST_NAME})
1254 add_test(${TEST_NAME}
1255 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTPROG})
1257 list(APPEND TEST_NAMES ${TEST_NAME})
1259 set_tests_properties(${TEST_NAME}
1260 PROPERTIES ENVIRONMENT "${ENV_VARS}")
1264 if (__FOUND_USABLE_PYTHON)
1265 set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME})
1267 add_test(${TEST_NAME}
1268 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents |
1269 ${PYTHON_EXECUTABLE}
1270 ${CMAKE_CURRENT_SOURCE_DIR}/test/check-dumpevents.py)
1272 set_tests_properties(${TEST_NAME}
1273 PROPERTIES ENVIRONMENT "${ENV_VARS}")
1275 message(WARNING "test-dumpevents will be run without output check since python was not found!")
1276 set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME}_no_check)
1278 add_test(${TEST_NAME}
1279 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents)
1281 set_tests_properties(${TEST_NAME}
1282 PROPERTIES ENVIRONMENT "${ENV_VARS}")
1286 if (NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON)
1287 set(TEST_NAME regress__${BACKEND_TEST_NAME})
1289 add_test(${TEST_NAME}
1290 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress --quiet)
1292 set_tests_properties(${TEST_NAME}
1293 PROPERTIES ENVIRONMENT "${ENV_VARS}")
1295 add_test(${TEST_NAME}_debug
1296 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress --quiet)
1298 set_tests_properties(${TEST_NAME}_debug
1299 PROPERTIES ENVIRONMENT "${ENV_VARS};EVENT_DEBUG_MODE=1")
1303 # Add the tests for each backend.
1304 foreach(BACKEND ${BACKENDS})
1305 # Enable this backend only.
1306 set(BACKEND_ENV_VARS ${DEFAULT_TEST_ENV_VARS})
1307 list(REMOVE_ITEM BACKEND_ENV_VARS EVENT_NO${BACKEND}=1)
1309 # Epoll has some extra settings.
1310 if (${BACKEND} STREQUAL "EPOLL")
1311 add_backend_test(timerfd_${BACKEND}
1312 "${BACKEND_ENV_VARS};EVENT_PRECISE_TIMER=1")
1314 add_backend_test(changelist_${BACKEND}
1315 "${BACKEND_ENV_VARS};EVENT_EPOLL_USE_CHANGELIST=yes")
1317 add_backend_test(timerfd_changelist_${BACKEND}
1318 "${BACKEND_ENV_VARS};EVENT_EPOLL_USE_CHANGELIST=yes;EVENT_PRECISE_TIMER=1")
1320 add_backend_test(${BACKEND} "${BACKEND_ENV_VARS}")
1325 # Rate limiter tests.
1328 # Group limits, no connection limit.
1329 set(RL_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim)
1331 add_test(test-ratelim__group_lim
1336 --check-grouplimit 1000
1339 # Connection limit, no group limit.
1340 add_test(test-ratelim__con_lim
1345 --check-connlimit 50
1348 # Connection limit and group limit.
1349 add_test(test-ratelim__group_con_lim
1355 --check-grouplimit 1000
1356 --check-connlimit 50
1359 # Connection limit and group limit with independent drain.
1360 add_test(test-ratelim__group_con_lim_drain
1367 --check-grouplimit 1000
1368 --check-connlimit 50
1371 # Add a "make verify" target, same as for autoconf.
1372 # (Important! This will unset all EVENT_NO* environment variables.
1373 # If they are set in the shell the tests are running using simply "ctest" or "make test" will fail)
1375 # Windows doesn't have "unset". But you can use "set VAR=" instead.
1376 # We need to guard against the possibility taht EVENT_NOWIN32 is set, and all test failing
1377 # since no event backend being available.
1378 file(TO_NATIVE_PATH ${CMAKE_CTEST_COMMAND} WINDOWS_CTEST_COMMAND)
1380 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat
1383 \"${WINDOWS_CTEST_COMMAND}\"
1386 message(STATUS "${WINDOWS_CTEST_COMMAND}")
1388 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat
1389 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
1396 WORLD_READ WORLD_EXECUTE)
1399 "${CMAKE_CURRENT_BINARY_DIR}/verify_tests.bat" VERIFY_PATH)
1401 add_custom_target(verify COMMAND "${VERIFY_PATH}"
1402 DEPENDS event ${ALL_TESTPROGS})
1404 # On some platforms doing exec(unset) as CMake does won't work, so make sure
1405 # we run the unset command in a shell instead.
1406 # First we write the script contents.
1407 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh
1410 unset EVENT_NOEPOLL; unset EVENT_NOPOLL; unset EVENT_NOSELECT; unset EVENT_NOWIN32; unset EVENT_NOEVPORT; unset EVENT_NOKQUEUE; unset EVENT_NODEVPOLL
1411 ${CMAKE_CTEST_COMMAND}
1414 # Then we copy the file (this allows us to set execute permission on it)
1415 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh
1416 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
1426 # Create the target that runs the script.
1427 add_custom_target(verify
1428 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/verify_tests.sh
1429 DEPENDS event ${ALL_TESTPROGS})
1432 if (NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON)
1433 add_dependencies(verify regress)
1436 if (EVENT__COVERAGE)
1437 include(CodeCoverage)
1439 setup_target_for_coverage(
1440 verify_coverage # Coverage target name "make verify_coverage"
1442 coverage # Output directory.
1443 verify) # Arguments passed to test runner. "make verify"
1452 # Installation preparation.
1455 set(EVENT_INSTALL_CMAKE_DIR
1456 "${CMAKE_INSTALL_PREFIX}/lib/cmake/libevent")
1458 export(PACKAGE libevent)
1460 function(gen_package_config forinstall)
1462 set(CONFIG_FOR_INSTALL_TREE 1)
1463 set(dir "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}")
1465 set(CONFIG_FOR_INSTALL_TREE 0)
1466 set(dir "${PROJECT_BINARY_DIR}")
1468 configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in
1469 "${dir}/LibeventConfig.cmake"
1473 # Generate the config file for the build-tree.
1474 set(EVENT__INCLUDE_DIRS
1475 "${PROJECT_SOURCE_DIR}/include"
1476 "${PROJECT_BINARY_DIR}/include")
1478 set(LIBEVENT_INCLUDE_DIRS
1479 ${EVENT__INCLUDE_DIRS}
1480 CACHE PATH "Libevent include directories")
1482 gen_package_config(0)
1484 # Generate the config file for the installation tree.
1485 gen_package_config(1)
1487 # Generate version info for both build-tree and install-tree.
1488 configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigVersion.cmake.in
1489 ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake
1492 # Install compat headers
1493 install(FILES ${HDR_COMPAT}
1494 DESTINATION "include"
1497 # Install public headers
1498 install(FILES ${HDR_PUBLIC}
1499 DESTINATION "include/event2"
1502 # Install the configs.
1504 ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake
1505 ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake
1506 DESTINATION "${EVENT_INSTALL_CMAKE_DIR}"
1509 # Install exports for the install-tree.
1510 macro(install_export type)
1511 install(EXPORT LibeventTargets-${type}
1512 NAMESPACE ${PROJECT_NAME}::
1513 DESTINATION "${EVENT_INSTALL_CMAKE_DIR}"
1517 if (${EVENT_LIBRARY_STATIC})
1518 install_export(static)
1520 if (${EVENT_LIBRARY_SHARED})
1521 install_export(shared)
1524 # Install the scripts.
1526 ${CMAKE_CURRENT_SOURCE_DIR}/event_rpcgen.py
1530 # Create documents with doxygen.
1531 option(EVENT__DOXYGEN
1532 "Enables doxygen documentation" OFF)
1539 if (NOT TARGET uninstall)
1540 # Create the uninstall target.
1541 # https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
1542 configure_file(${PROJECT_SOURCE_DIR}/cmake/Uninstall.cmake.in
1543 ${PROJECT_BINARY_DIR}/Uninstall.cmake
1546 add_custom_target(uninstall
1547 COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/Uninstall.cmake)
1551 message(STATUS " ---( Libevent " ${EVENT_VERSION} " )---")
1553 message(STATUS "Available event backends: ${BACKENDS}")
1554 message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
1555 message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
1556 message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
1557 message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
1558 message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}")
1559 message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
1560 message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
1561 message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
1562 message(STATUS "CMAKE_ROOT: ${CMAKE_ROOT}")
1563 message(STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
1564 message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
1565 message(STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
1566 message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
1567 message(STATUS "CMAKE_SKIP_RPATH: ${CMAKE_SKIP_RPATH}")
1568 message(STATUS "CMAKE_VERBOSE_MAKEFILE: ${CMAKE_VERBOSE_MAKEFILE}")
1569 message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
1570 message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
1571 message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER} (id ${CMAKE_C_COMPILER_ID}, clang ${CLANG}, GNUC ${GNUC})")
1572 message(STATUS "CMAKE_AR: ${CMAKE_AR}")
1573 message(STATUS "CMAKE_RANLIB: ${CMAKE_RANLIB}")