summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 93c681bbf6540ef537e847ca561d96a841ee58dc (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
add_library(aec ${LIB_TYPE} ${libaec_SRCS})
set_target_properties(aec PROPERTIES VERSION 0.0.8 SOVERSION 0)
add_library(sz ${LIB_TYPE} sz_compat.c)
set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2)

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)

include(GNUInstallDirs)
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)
  install(FILES aec.1
    DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 COMPONENT doc)
endif(WIN32)

install(FILES libaec.h szlib.h
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
  COMPONENT headers)
install(TARGETS aec_client
  RUNTIME
  DESTINATION ${CMAKE_INSTALL_BINDIR}
  COMPONENT applications)

set(CPACK_COMPONENTS_ALL applications libraries headers doc)