2011/07/12

A CMake module for finding librsync: Findrsync.cmake

I realize this isn't very hard to write, but if I can save one person five minutes, it's worth it. The latest version of the code can be found at https://gist.github.com/1077849.

# Written by Ives van der Flaas , 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)
   
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)

No comments:

Post a Comment