freebsd-skq/cpio/CMakeLists.txt
Martin Matuska 81418b36c0 Update libarchive's vendor dist to version 3.0.4 from release branch.
Git branch:	release
Git commit:	8076b31490c90aaf0edccecf760004c30bd95edc

Obtained from:	https://github.com/libarchive/libarchive.git
2012-07-27 08:24:12 +00:00

48 lines
1.3 KiB
CMake

############################################
#
# How to build bsdcpio
#
############################################
IF(ENABLE_CPIO)
SET(bsdcpio_SOURCES
cmdline.c
cpio.c
cpio.h
cpio_platform.h
../libarchive_fe/err.c
../libarchive_fe/err.h
../libarchive_fe/lafe_platform.h
../libarchive_fe/line_reader.c
../libarchive_fe/line_reader.h
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)
IF(WIN32 AND NOT CYGWIN)
LIST(APPEND bsdcpio_SOURCES cpio_windows.c)
LIST(APPEND bsdcpio_SOURCES cpio_windows.h)
ENDIF(WIN32 AND NOT CYGWIN)
# bsdcpio documentation
SET(bsdcpio_MANS bsdcpio.1)
# How to build bsdcpio
ADD_EXECUTABLE(bsdcpio ${bsdcpio_SOURCES})
IF(ENABLE_CPIO_SHARED)
TARGET_LINK_LIBRARIES(bsdcpio archive ${ADDITIONAL_LIBS})
ELSE(ENABLE_CPIO_SHARED)
TARGET_LINK_LIBRARIES(bsdcpio archive_static ${ADDITIONAL_LIBS})
SET_TARGET_PROPERTIES(bsdcpio PROPERTIES COMPILE_DEFINITIONS
LIBARCHIVE_STATIC)
ENDIF(ENABLE_CPIO_SHARED)
# Full path to the compiled executable (used by test suite)
GET_TARGET_PROPERTY(BSDCPIO bsdcpio LOCATION)
# Installation rules
INSTALL(TARGETS bsdcpio RUNTIME DESTINATION bin)
INSTALL_MAN(${bsdcpio_MANS})
ENDIF(ENABLE_CPIO)
# Test suite
add_subdirectory(test)