diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2013-09-03 22:09:20 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2013-09-03 22:09:20 +0000 |
| commit | 34b5d124a1af99836567190a1e2a9da671d6c027 (patch) | |
| tree | b2186e3840bf56209a9599cef7872150dfb22501 /qpid/cpp/src | |
| parent | 1fdfd9b2acf01699e8fb7ac7b08c1f532587b1a8 (diff) | |
| download | qpid-python-34b5d124a1af99836567190a1e2a9da671d6c027.tar.gz | |
QPID-5112: Simplify windows/non windows checks
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1519867 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/CMakeLists.txt | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt index ba4eeaeaa7..c408a085f5 100644 --- a/qpid/cpp/src/CMakeLists.txt +++ b/qpid/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 |
