summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
blob: 9b4d21d3ca801da4d743dfde5cb69c08419b1c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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}
)