aboutsummaryrefslogtreecommitdiffstats
path: root/cat/CMakeLists.txt
blob: 4fe6354b3131e98be25a01386a094a01f7a8b4ec (plain) (blame)
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
############################################
#
# How to build bsdcat
#
############################################
IF(ENABLE_CAT)

  SET(bsdcat_SOURCES
    bsdcat.c
    bsdcat.h
    bsdcat_platform.h
    cmdline.c
    ../libarchive_fe/err.c
    ../libarchive_fe/err.h
    ../libarchive_fe/lafe_platform.h
  )
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)

  # bsdcat documentation
  SET(bsdcat_MANS bsdcat.1)

  # How to build bsdcat
  ADD_EXECUTABLE(bsdcat ${bsdcat_SOURCES})
  IF(ENABLE_CAT_SHARED)
    TARGET_LINK_LIBRARIES(bsdcat archive ${ADDITIONAL_LIBS})
  ELSE(ENABLE_CAT_SHARED)
    TARGET_LINK_LIBRARIES(bsdcat archive_static ${ADDITIONAL_LIBS})
    SET_TARGET_PROPERTIES(bsdcat PROPERTIES COMPILE_DEFINITIONS
    				 LIBARCHIVE_STATIC)
  ENDIF(ENABLE_CAT_SHARED)

  # Installation rules
  INSTALL(TARGETS bsdcat RUNTIME DESTINATION bin)
  INSTALL_MAN(${bsdcat_MANS})
ENDIF(ENABLE_CAT)

add_subdirectory(test)