Skip to content

Instantly share code, notes, and snippets.

@Ivesvdf
Created July 12, 2011 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ivesvdf/1077849 to your computer and use it in GitHub Desktop.
Save Ivesvdf/1077849 to your computer and use it in GitHub Desktop.
A CMake module script for including librsync
# Written by Ives van der Flaas <ives.vdf@gmail.com>, 2011
#
# License: Public domain.
#
# Defines
#
# RSYNC_INCLUDE_DIRS
# which contains the include directory for librsync.h
#
# RSYNC_LIBRARIES
# which contains the library directory for librsync.a
set( SEARCHPATH /usr /usr/local /opt /opt/local $ENV{HOME}/opt
${CMAKE_SOURCE_DIR}/external/)
find_path( RSYNC_INCLUDE_DIRS librsync.h
PATHS ${SEARCHPATH}
PATH_SUFFIXES include
)
find_library( RSYNC_LIBRARIES rsync
PATHS ${SEARCHPATH}
PATH_SUFFIXES lib
)
unset( SEARCHPATH )
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(rsync DEFAULT_MSG RSYNC_LIBRARIES RSYNC_INCLUDE_DIRS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment