summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2019-10-06 15:05:09 +0200
committergregory guy <gregory-tde@laposte.net>2019-10-10 15:33:12 +0200
commit19b046ec429c32f88658352232e6cc92276dff97 (patch)
treee30dcea233469b21cc6981e03fd22b678cbcb22c /src
parentceb78a2a816a6b9614871764d7d18e3a6134bc0a (diff)
downloadlibcaldav-19b046ec429c32f88658352232e6cc92276dff97.tar.gz
libcaldav-19b046ec429c32f88658352232e6cc92276dff97.zip
Conversion to the cmake building system.
rfc4791.pdf has been moved to the doc folder. caldav pc file has been moved in the src folder. Signed-off-by: gregory guy <gregory-tde@laposte.net>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt74
-rw-r--r--src/libcaldav.pc.cmake15
2 files changed, 89 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..9b4d21d
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,74 @@
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${GTHREAD_INCLUDE_DIRS}
+ ${CURL_INCLUDE_DIRS}
+)
+
+
+set( _SRC caldav.c
+ add-caldav-object.c
+ delete-caldav-object.c
+ modify-caldav-object.c
+ get-caldav-report.c
+ get-display-name.c
+ caldav-utils.c
+ caldav-utils.h md5.c
+ options-caldav-server.c
+ lock-caldav-object.c
+ get-freebusy-report.c
+)
+
+
+##### caldav (shared)
+
+tde_add_library( caldav SHARED
+
+ SOURCES
+ ${_SRC}
+ LINK
+ ${GTHREAD_LIBRARIES}
+ ${CURL_LIBRARIES}
+
+ VERSION 0.0.6
+
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+if( BUILD_CALDAV_TEST OR BUILD_UNITTEST )
+##### caldav (static)
+
+tde_add_library( caldav STATIC
+
+ SOURCES
+ ${_SRC}
+ LINK
+ ${GTHREAD_LIBRARIES}
+ ${CURL_LIBRARIES}
+)
+endif()
+
+
+#### 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 caldav.h
+ DESTINATION ${INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME}
+)
diff --git a/src/libcaldav.pc.cmake b/src/libcaldav.pc.cmake
new file mode 100644
index 0000000..c8f4b6f
--- /dev/null
+++ b/src/libcaldav.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 CalDAV
+
+Requires.private: gthread-2.0 libcurl
+Cflags: -I${includedir}
+Libs: -L${libdir} -lcaldav