summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 7b4de30fbb5e2d2063abdb497284d027774c3856 (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
SET(libaec_SRCS encode.c encode_accessors.c decode.c)
ADD_LIBRARY(aec ${LIB_TYPE} ${libaec_SRCS})
SET_TARGET_PROPERTIES(aec PROPERTIES
  SOVERSION 0.0.5
  )
ADD_LIBRARY(sz ${LIB_TYPE} sz_compat.c)
SET_TARGET_PROPERTIES(sz PROPERTIES
  SOVERSION 2.0.1
  )

TARGET_LINK_LIBRARIES(sz aec)
IF(WIN32 AND BUILD_SHARED_LIBS)
  SET_TARGET_PROPERTIES (aec PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC")
  SET_TARGET_PROPERTIES (sz PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC")
  SET_TARGET_PROPERTIES(sz PROPERTIES OUTPUT_NAME "szip")
ENDIF(WIN32 AND BUILD_SHARED_LIBS)

ADD_EXECUTABLE(aec_client aec.c)
SET_TARGET_PROPERTIES(aec_client PROPERTIES OUTPUT_NAME "aec")
TARGET_LINK_LIBRARIES(aec_client aec)

IF(UNIX)
  ADD_EXECUTABLE(utime EXCLUDE_FROM_ALL utime.c)
  ADD_CUSTOM_TARGET(bench
    COMMAND ${CMAKE_SOURCE_DIR}/src/benc.sh ${CMAKE_SOURCE_DIR}/data/typical.rz
    COMMAND ${CMAKE_SOURCE_DIR}/src/bdec.sh
    DEPENDS aec_client utime
    )
ENDIF(UNIX)

IF(WIN32)
  INSTALL(TARGETS aec sz
    RUNTIME
    DESTINATION bin
    ARCHIVE
    DESTINATION lib
    COMPONENT libraries
    )
ELSE(WIN32)
  INSTALL(TARGETS aec sz
    LIBRARY
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT libraries
    )
ENDIF(WIN32)
INSTALL(FILES libaec.h szlib.h
  DESTINATION include
  COMPONENT headers
  )
INSTALL(TARGETS aec_client
  RUNTIME
  DESTINATION bin
  COMPONENT applications
  )

SET(CPACK_COMPONENTS_ALL applications libraries headers)