cmake_minimum_required(VERSION 2.8) INCLUDE(CheckFunctionExists) project(unzip C) CHECK_FUNCTION_EXISTS(lchmod HAVE_LCHMOD) if(NOT HAVE_LCHMOD) add_definitions("-DNO_LCHMOD") endif() set(UNZIP_SOURCES unzip.c crc32.c crypt.c envargs.c explode.c extract.c fileio.c globals.c inflate.c list.c match.c process.c ttyio.c ubz2err.c unreduce.c unshrink.c zipinfo.c unix/unix.c) include_directories(.) add_executable(unzip ${UNZIP_SOURCES}) install(TARGETS unzip DESTINATION bin)