From e2b50ac8f07a0fd04ee7ad5f4ad72075fddad215 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Wed, 9 Oct 2019 14:34:13 +0200 Subject: Conversion to the cmake building system. rfc4791.pdf has been moved to the doc folder. carddav pc file has been moved to the src folder. Signed-off-by: gregory guy --- src/CMakeLists.txt | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ src/libcarddav.pc.cmake | 15 ++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/libcarddav.pc.cmake (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..23fbeb9 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,55 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GTHREAD_INCLUDE_DIRS} + ${CURL_INCLUDE_DIRS} +) + + +##### carddav (shared) + +tde_add_library( carddav SHARED + + SOURCES + carddav.c + add-carddav-object.c + delete-carddav-object.c + modify-carddav-object.c + get-carddav-report.c + get-display-name.c + carddav-utils.c + md5.c + options-carddav-server.c + lock-carddav-object.c + LINK + ${GTHREAD_LIBRARIES} + ${CURL_LIBRARIES} + + VERSION 0.0.6 + + DESTINATION ${LIB_INSTALL_DIR} +) + + +#### pkg-config + +set( prefix ${CMAKE_INSTALL_PREFIX} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} ) + +configure_file( ${CMAKE_PROJECT_NAME}.pc.cmake ${CMAKE_PROJECT_NAME}.pc @ONLY ) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pc + DESTINATION ${PKGCONFIG_INSTALL_DIR} +) + + +##### header + +install( + FILES carddav.h + DESTINATION ${INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME} +) diff --git a/src/libcarddav.pc.cmake b/src/libcarddav.pc.cmake new file mode 100644 index 0000000..b9be1c7 --- /dev/null +++ b/src/libcarddav.pc.cmake @@ -0,0 +1,15 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@PC_EXEC_PREFIX@ +libdir=@PC_LIB_DIR@ +includedir=@PC_INCLUDE_DIR@ + +pkglibdir=${libdir} +pkgincludedir=${includedir}/@PROJECT_NAME@ + +Name: @PROJECT_NAME@ +Version: @PACKAGE_VERSION@ +Description: @PROJECT_NAME@ is a client library for CardDAV + +Requires.private: gthread-2.0 libcurl +Cflags: -I${includedir} +Libs: -L${libdir} -lcarddav -- cgit v1.2.1