From b72908548dc841de65dc9288a96c1abe648acc46 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 21 Nov 2013 00:21:32 +0100 Subject: Let the user choose the poller to use through cmake POLLER option Use ccmake, or cmake -i, or cmake -DPOLLER=EPOLL, for example --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e82b4..2c01ee3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,12 @@ include_directories(${ICONV_INCLUDE_DIR}) # coming from these headers. include_directories(SYSTEM ${CRYPTO++_INCLUDE_DIR}) +set(POLLER "POLL" CACHE STRING + "Choose the poller between POLL and EPOLL (Linux-only)") +if((NOT ${POLLER} MATCHES "POLL") AND + (NOT ${POLLER} MATCHES "EPOLL")) + message(FATAL_ERROR "POLLER must be either POLL or EPOLL") +endif() # ## utils # @@ -95,4 +101,4 @@ target_link_libraries(test utils config) -CONFIGURE_FILE(config.h.cmake src/config.h @ONLY) +configure_file(config.h.cmake src/config.h) -- cgit v1.2.3