CMakeLists.txt 1.44 KB
Newer Older
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
1 2 3 4
add_library(aec ${LIB_TYPE} ${libaec_SRCS})
set_target_properties(aec PROPERTIES VERSION 0.0.6 SOVERSION 0)
add_library(sz ${LIB_TYPE} sz_compat.c)
set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2)
5

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
6 7 8 9 10 11
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)
12

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
13 14 15
add_executable(aec_client aec.c)
set_target_properties(aec_client PROPERTIES OUTPUT_NAME "aec")
target_link_libraries(aec_client aec)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
16

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
17 18 19
if(UNIX)
  add_executable(utime EXCLUDE_FROM_ALL utime.c)
  add_custom_target(bench
20 21
    COMMAND ${CMAKE_SOURCE_DIR}/src/benc.sh ${CMAKE_SOURCE_DIR}/data/typical.rz
    COMMAND ${CMAKE_SOURCE_DIR}/src/bdec.sh
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
22 23
    DEPENDS aec_client utime)
endif(UNIX)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
24

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
25 26 27
include(GNUInstallDirs)
if(WIN32)
  install(TARGETS aec sz
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
28 29 30 31
    RUNTIME
    DESTINATION bin
    ARCHIVE
    DESTINATION lib
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
32 33 34
    COMPONENT libraries)
else(WIN32)
  install(TARGETS aec sz
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
35
    LIBRARY
36
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
37
    ARCHIVE
38
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
39 40 41
    COMPONENT libraries)
endif(WIN32)
install(FILES libaec.h szlib.h
42
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
43 44
  COMPONENT headers)
install(TARGETS aec_client
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
45
  RUNTIME
46
  DESTINATION ${CMAKE_INSTALL_BINDIR}
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
47
  COMPONENT applications)
48

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
49
set(CPACK_COMPONENTS_ALL applications libraries headers)