From 8e3c3d25cb51dc2ceb2044dec545dc4028cfe39a Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Fri, 8 Feb 2019 18:10:21 -0500 Subject: [PATCH] Define off64_t=off_t for macOS Detect the systemd binary and install the systemd units conditionally. --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 951d874..2373eb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,19 @@ set( GRIVE_VERSION "0.5.1-dev" ) # common compile options add_definitions( -DVERSION="${GRIVE_VERSION}" ) add_definitions( -D_FILE_OFFSET_BITS=64 -std=c++0x ) +if ( APPLE ) + add_definitions( -Doff64_t=off_t ) +endif ( APPLE ) + +find_program( + HAVE_SYSTEMD systemd + PATHS /lib/systemd /usr/lib/systemd + NO_DEFAULT_PATH +) +if ( HAVE_SYSTEMD ) + add_subdirectory( systemd ) +endif( NOT HAVE_SYSTEMD ) -add_subdirectory( systemd ) add_subdirectory( libgrive ) add_subdirectory( grive ) - \ No newline at end of file +