# Build main roy library 

ADD_LIBRARY(roy
    rarray.c
    rbhash.c
    rbucket.c
    rbuf.c
    rbuf_gzip.c
    rchunk.c
    rcleanup.c
    rdebug.c
    rhash.c
    rinit.c
    rlist.c
    rlist_of.c
    rmain.c
    rmdbg.c
    rmisc.c
    rstr.c
    rtherml.c
    rthread.c
    rxp.c
    trio.c
    trionan.c
    triostr.c
)

TARGET_LINK_LIBRARIES(roy ${ZLIB_LOCATION} ${LIBM_LOCATION})
IF(UNIX)
    TARGET_LINK_LIBRARIES(roy ${PTHREAD_LOCATION})
ENDIF(UNIX)

IF(LIBSOCKET_LOCATION)
    TARGET_LINK_LIBRARIES(roy ${LIBSOCKET_LOCATION})
ENDIF(LIBSOCKET_LOCATION)

IF(LIBNSL_LOCATION)
    TARGET_LINK_LIBRARIES(roy ${LIBNSL_LOCATION})
ENDIF(LIBNSL_LOCATION)


INSTALL_TARGETS(/lib/ roy)

INSTALL_FILES(/include/roy/ FILES
    rargv.h
    rarray.h
    rbhash.h
    rbuf.h
    rbuf_gzip.h
    rchunk.h
    rcleanup.h
    rdebug.h
    rflag.h
    rhash.h
    rinit.h
    rlist.h
    rlist_of.h
    rmain.h
    rmdbg.h
    rmdbg_interfaces.h
    rmem.h
    rmisc.h
    roy-config.h
    rstr.h
    rtherml.h
    rthread.h
    rxp.h
)

