summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-09-03 22:09:20 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-09-03 22:09:20 +0000
commit73bfa8dc7f31b66da9f5420f95107ac87af63a64 (patch)
treeea5f7457e384d82e3b00572329eeab4261f0faab /cpp
parent38b177680793ae87a66d7fa6ed8d9c34ea3e1bcd (diff)
downloadqpid-python-73bfa8dc7f31b66da9f5420f95107ac87af63a64.tar.gz
QPID-5112: Simplify windows/non windows checks
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1519867 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/CMakeLists.txt58
1 files changed, 30 insertions, 28 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
index ba4eeaeaa7..c408a085f5 100644
--- a/cpp/src/CMakeLists.txt
+++ b/cpp/src/CMakeLists.txt
@@ -538,47 +538,49 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../include )
link_directories( ${Boost_LIBRARY_DIRS} )
-CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
-if (NOT CLOCK_GETTIME_IN_LIBC)
+# These dependencies aren't found on windows
+if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
+ # Ensure we have clock_gettime
+ CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
+ if (NOT CLOCK_GETTIME_IN_LIBC)
CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_RT)
if (CLOCK_GETTIME_IN_RT)
set(clock_gettime_LIB "rt")
else ()
message(FATAL_ERROR "Cannot find clock_gettime()")
endif (CLOCK_GETTIME_IN_RT)
-endif (NOT CLOCK_GETTIME_IN_LIBC)
-
-# Check for header file for dtrace static probes
-check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
-if (HAVE_SYS_SDT_H)
- set(probes_default ON)
-endif (HAVE_SYS_SDT_H)
-option(BUILD_PROBES "Build with DTrace/systemtap static probes" ${probes_default})
-if (NOT BUILD_PROBES)
- set (HAVE_SYS_SDT_H 0)
-endif (NOT BUILD_PROBES)
-
-# Check for poll/epoll header files
-check_include_files(sys/poll.h HAVE_POLL)
-check_include_files(sys/epoll.h HAVE_EPOLL)
-
-# Set default poller implementation (check from general to specific to allow overriding)
-if (HAVE_POLL)
- set(poller_default poll)
-endif (HAVE_POLL)
-if (HAVE_EPOLL)
- set(poller_default epoll)
-endif (HAVE_EPOLL)
-set(POLLER ${poller_default} CACHE STRING "Poller implementation (poll/epoll)")
+ endif (NOT CLOCK_GETTIME_IN_LIBC)
-# If not windows ensure that we have uuid library
-if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
+ # Ensure we have uuid library
CHECK_LIBRARY_EXISTS (uuid uuid_compare "" HAVE_UUID)
CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
if (NOT HAVE_UUID AND NOT HAVE_UUID_H)
message(FATAL_ERROR "Uuid library and/or header file not found")
endif (NOT HAVE_UUID AND NOT HAVE_UUID_H)
set (uuid_LIB "uuid")
+
+ # Check for header file for dtrace static probes
+ check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
+ if (HAVE_SYS_SDT_H)
+ set(probes_default ON)
+ endif (HAVE_SYS_SDT_H)
+ option(BUILD_PROBES "Build with DTrace/systemtap static probes" ${probes_default})
+ if (NOT BUILD_PROBES)
+ set (HAVE_SYS_SDT_H 0)
+ endif (NOT BUILD_PROBES)
+
+ # Check for poll/epoll header files
+ check_include_files(sys/poll.h HAVE_POLL)
+ check_include_files(sys/epoll.h HAVE_EPOLL)
+
+ # Set default poller implementation (check from general to specific to allow overriding)
+ if (HAVE_POLL)
+ set(poller_default poll)
+ endif (HAVE_POLL)
+ if (HAVE_EPOLL)
+ set(poller_default epoll)
+ endif (HAVE_EPOLL)
+ set(POLLER ${poller_default} CACHE STRING "Poller implementation (poll/epoll)")
endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
# See if Cyrus SASL is desired and available