CMakeLists.txt 1.53 KB
Newer Older
1
SET(libaec_SRCS encode.c encode_accessors.c decode.c)
2
ADD_LIBRARY(aec ${LIB_TYPE} ${libaec_SRCS})
3
SET_TARGET_PROPERTIES(aec PROPERTIES
4
  VERSION 0.0.6 SOVERSION 0
5
  )
6
ADD_LIBRARY(sz ${LIB_TYPE} sz_compat.c)
7
SET_TARGET_PROPERTIES(sz PROPERTIES
8
  VERSION 2.0.1 SOVERSION 2
9
  )
10

11
TARGET_LINK_LIBRARIES(sz aec)
12
IF(WIN32 AND BUILD_SHARED_LIBS)
13 14
  SET_TARGET_PROPERTIES (aec PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC")
  SET_TARGET_PROPERTIES (sz PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC")
15
  SET_TARGET_PROPERTIES(sz PROPERTIES OUTPUT_NAME "szip")
16
ENDIF(WIN32 AND BUILD_SHARED_LIBS)
17

18 19 20
ADD_EXECUTABLE(aec_client aec.c)
SET_TARGET_PROPERTIES(aec_client PROPERTIES OUTPUT_NAME "aec")
TARGET_LINK_LIBRARIES(aec_client aec)
21

22 23
IF(UNIX)
  ADD_EXECUTABLE(utime EXCLUDE_FROM_ALL utime.c)
24 25 26 27 28
  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
    )
29
ENDIF(UNIX)
30

31
INCLUDE(GNUInstallDirs)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
32 33 34 35 36 37 38 39 40 41 42
IF(WIN32)
  INSTALL(TARGETS aec sz
    RUNTIME
    DESTINATION bin
    ARCHIVE
    DESTINATION lib
    COMPONENT libraries
    )
ELSE(WIN32)
  INSTALL(TARGETS aec sz
    LIBRARY
43
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
44
    ARCHIVE
45
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
46 47 48
    COMPONENT libraries
    )
ENDIF(WIN32)
49
INSTALL(FILES libaec.h szlib.h
50
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
51 52
  COMPONENT headers
  )
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
53 54
INSTALL(TARGETS aec_client
  RUNTIME
55
  DESTINATION ${CMAKE_INSTALL_BINDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
56
  COMPONENT applications
57
  )
58

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
59
SET(CPACK_COMPONENTS_ALL applications libraries headers)