1############################################ 2# 3# How to build bsdtar 4# 5############################################ 6IF (ENABLE_TAR) 7 8 SET(bsdtar_SOURCES 9 bsdtar.c 10 bsdtar.h 11 bsdtar_platform.h 12 cmdline.c 13 getdate.c 14 read.c 15 subst.c 16 tree.c 17 tree.h 18 util.c 19 write.c 20 ../libarchive_fe/err.c 21 ../libarchive_fe/err.h 22 ../libarchive_fe/lafe_platform.h 23 ../libarchive_fe/line_reader.c 24 ../libarchive_fe/line_reader.h 25 ../libarchive_fe/matching.c 26 ../libarchive_fe/matching.h 27 ../libarchive_fe/pathmatch.c 28 ../libarchive_fe/pathmatch.h 29 ) 30 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe) 31 IF(WIN32 AND NOT CYGWIN) 32 LIST(APPEND bsdtar_SOURCES bsdtar_windows.c) 33 LIST(APPEND bsdtar_SOURCES bsdtar_windows.h) 34 ENDIF(WIN32 AND NOT CYGWIN) 35 36 # bsdtar documentation 37 SET(bsdtar_MANS bsdtar.1) 38 39 # How to build bsdtar 40 ADD_EXECUTABLE(bsdtar ${bsdtar_SOURCES}) 41 IF(ENABLE_TAR_SHARED) 42 TARGET_LINK_LIBRARIES(bsdtar archive ${ADDITIONAL_LIBS}) 43 ELSE(ENABLE_TAR_SHARED) 44 TARGET_LINK_LIBRARIES(bsdtar archive_static ${ADDITIONAL_LIBS}) 45 SET_TARGET_PROPERTIES(bsdtar PROPERTIES COMPILE_DEFINITIONS 46 LIBARCHIVE_STATIC) 47 ENDIF(ENABLE_TAR_SHARED) 48 GET_TARGET_PROPERTY(BSDTAR bsdtar LOCATION) 49 50 # Installation rules 51 INSTALL(TARGETS bsdtar RUNTIME DESTINATION bin) 52 INSTALL_MAN(${bsdtar_MANS}) 53ENDIF(ENABLE_TAR) 54 55add_subdirectory(test) 56