summaryrefslogtreecommitdiff
path: root/src/lib/emile/CMakeLists.txt
blob: 559f7355b6a2388e13ba4d1a1d2a92443f14b277 (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
set(DESCRIPTION "Library for simplified serialization, compression and ciphering")

set(PKG_CONFIG_REQUIRES_PRIVATE
  zlib>=1.2.3
  libjpeg
)

set(LIBRARIES
  eina
  m
)

set(PUBLIC_HEADERS
  Emile.h
  emile_base64.h
  emile_cipher.h
  emile_compress.h
  emile_image.h
)

set(SOURCES
  emile_base64.c
  emile_compress.c
  emile_image.c
  emile_main.c
  emile_private.h
  ${CMAKE_SOURCE_DIR}/src/static_libs/rg_etc/etc2_encoder.c
  ${CMAKE_SOURCE_DIR}/src/static_libs/rg_etc/rg_etc1.c
  ${CMAKE_SOURCE_DIR}/src/static_libs/rg_etc/rg_etc1.h
  ${CMAKE_SOURCE_DIR}/src/static_libs/rg_etc/rg_etc2.c
)

set(INCLUDE_DIRECTORIES
  ${CMAKE_SOURCE_DIR}/src/static_libs/rg_etc
)

if(WITH_CRYPTO STREQUAL "gnutls")
  list(APPEND SOURCES emile_cipher_gnutls.c)
  list(APPEND PKG_CONFIG_REQUIRES_PRIVATE gnutls)
elseif(WITH_CRYPTO STREQUAL "openssl")
  list(APPEND SOURCES emile_cipher_openssl.c)
  list(APPEND PKG_CONFIG_REQUIRES_PRIVATE openssl)
else()
  list(APPEND SOURCES emile_cipher.c)
endif()

if(WITH_LZ4 STREQUAL "system")
  list(APPEND PKG_CONFIG_REQUIRES_PRIVATE liblz4)
else()
  list(APPEND SOURCES
    ${CMAKE_SOURCE_DIR}/src/static_libs/lz4/lz4.c
    ${CMAKE_SOURCE_DIR}/src/static_libs/lz4/lz4.h
    ${CMAKE_SOURCE_DIR}/src/static_libs/lz4/lz4hc.c
    ${CMAKE_SOURCE_DIR}/src/static_libs/lz4/lz4hc.h
  )
  list(APPEND INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/static_libs/lz4)
endif()