"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.5.2/CMakeLists.txt" (12 Mar 2019, 13184 Bytes) of package /linux/misc/libzip-1.5.2.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 1.5.1_vs_1.5.2.

    1 # TODO:
    2 # create usable libtool .la file
    3 
    4 CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
    5 
    6 LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
    7 
    8 PROJECT(libzip C)
    9 
   10 OPTION(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON)
   11 OPTION(ENABLE_GNUTLS "Enable use of GnuTLS" ON)
   12 OPTION(ENABLE_MBEDTLS "Enable use of mbed TLS" ON)
   13 OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
   14 OPTION(ENABLE_WINDOWS_CRYPTO "Enable use of Windows cryptography libraries" ON)
   15 
   16 OPTION(ENABLE_BZIP2 "Enable use of BZip2" ON)
   17 
   18 OPTION(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON)
   19 OPTION(BUILD_REGRESS "Build regression tests" ON)
   20 OPTION(BUILD_EXAMPLES "Build examples" ON)
   21 OPTION(BUILD_DOC "Build documentation" ON)
   22 
   23 INCLUDE(CheckFunctionExists)
   24 INCLUDE(CheckIncludeFiles)
   25 INCLUDE(CheckSymbolExists)
   26 INCLUDE(CheckTypeSize)
   27 INCLUDE(CheckCSourceRuns)
   28 INCLUDE(CheckCSourceCompiles)
   29 INCLUDE(CheckStructHasMember)
   30 INCLUDE(TestBigEndian)
   31 INCLUDE(GNUInstallDirs)
   32 IF(ENABLE_COMMONCRYPTO)
   33   CHECK_INCLUDE_FILES(CommonCrypto/CommonCrypto.h COMMONCRYPTO_FOUND)
   34 ELSE()
   35   SET(COMMONCRYPTO_FOUND FALSE)
   36 ENDIF()
   37 IF(ENABLE_GNUTLS)
   38   INCLUDE(FindNettle)
   39   INCLUDE(FindGnuTLS)
   40 ELSE()
   41   SET(GNUTLS_FOUND FALSE)
   42 ENDIF()
   43 IF(ENABLE_MBEDTLS)
   44   FIND_PATH(MBEDTLS_INCLUDE_DIR mbedtls/aes.h)
   45   FIND_LIBRARY(MBEDTLS_LIBRARIES NAMES mbedtls)
   46 ELSE()
   47   SET(MBEDTLS_LIBRARIES FALSE)
   48 ENDIF()
   49 IF(ENABLE_OPENSSL)
   50   INCLUDE(FindOpenSSL)
   51 ELSE()
   52   SET(OPENSSL_FOUND FALSE)
   53 ENDIF()
   54 IF(WIN32)
   55   IF(ENABLE_WINDOWS_CRYPTO)
   56     SET(WINDOWS_CRYPTO_FOUND TRUE)
   57   ENDIF()
   58 ELSE()
   59   SET(WINDOWS_CRYPTO_FOUND FALSE)
   60 ENDIF()
   61 
   62 OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
   63 
   64 
   65 OPTION(SHARED_LIB_VERSIONNING "Add SO version in .so build" ON)
   66 
   67 FIND_PROGRAM(MDOCTOOL NAMES mandoc groff)
   68 IF (MDOCTOOL)
   69   SET(DOCUMENTATION_FORMAT "mdoc" CACHE STRING "Documentation format")
   70 ELSE()
   71   FIND_PROGRAM(MANTOOL NAMES nroff)
   72   IF (MANTOOL)
   73     SET(DOCUMENTATION_FORMAT "man" CACHE STRING "Documentation format")
   74   ELSE()
   75     SET(DOCUMENTATION_FORMAT "html" CACHE STRING "Documentation format")
   76   ENDIF()
   77 ENDIF()
   78 
   79 SET(PACKAGE "libzip")
   80 SET(PACKAGE_NAME ${PACKAGE})
   81 SET(PACKAGE_VERSION_MAJOR "1")
   82 SET(PACKAGE_VERSION_MINOR "5")
   83 SET(PACKAGE_VERSION_MICRO "2")
   84 #SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
   85 SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_MICRO}")
   86 SET(PACKAGE_VERSION ${VERSION})
   87 SET(LIBZIP_VERSION ${PACKAGE_VERSION})
   88 SET(LIBZIP_VERSION_MAJOR ${PACKAGE_VERSION_MAJOR})
   89 SET(LIBZIP_VERSION_MINOR ${PACKAGE_VERSION_MINOR})
   90 SET(LIBZIP_VERSION_MICRO ${PACKAGE_VERSION_MICRO})
   91 SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   92 
   93 SET(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
   94 ADD_CUSTOM_TARGET(dist
   95   COMMAND git config tar.tar.xz.command "xz -c"
   96   COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.gz HEAD
   97   COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.xz HEAD
   98   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
   99   )
  100 ADD_CUSTOM_TARGET(distcheck
  101   COMMAND chmod -R u+w ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest 2>/dev/null || true
  102   COMMAND rm -rf ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest
  103   COMMAND cmake -E tar xf ${ARCHIVE_NAME}.tar.gz
  104   COMMAND chmod -R u-w ${ARCHIVE_NAME}
  105   COMMAND mkdir ${ARCHIVE_NAME}-build
  106   COMMAND mkdir ${ARCHIVE_NAME}-dest
  107   COMMAND cd ${ARCHIVE_NAME}-build && cmake -DCMAKE_INSTALL_PREFIX=../${ARCHIVE_NAME}-dest ../${ARCHIVE_NAME}
  108   COMMAND cd ${ARCHIVE_NAME}-build && make -j4
  109   COMMAND cd ${ARCHIVE_NAME}-build && make test
  110   COMMAND cd ${ARCHIVE_NAME}-build && make install
  111 #  COMMAND cd ${ARCHIVE_NAME}-build && make uninstall
  112 #  COMMAND if [ `find ${ARCHIVE_NAME}-dest ! -type d | wc -l` -ne 0 ]; then echo leftover files in ${ARCHIVE_NAME}-dest; false; fi
  113   COMMAND cd ${ARCHIVE_NAME}-build && make clean
  114   COMMAND chmod -R u+w ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest
  115   COMMAND rm -rf ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest
  116   COMMAND echo "${ARCHIVE_NAME}.tar.gz is ready for distribution."
  117   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  118   )
  119 ADD_DEPENDENCIES(distcheck dist)
  120 
  121 IF(BUILD_SHARED_LIBS)
  122   SET(HAVE_SHARED TRUE)
  123 ELSE()
  124   SET(ZIP_STATIC TRUE)
  125 ENDIF()
  126 
  127 # Checks
  128 
  129 CHECK_FUNCTION_EXISTS(_chmod HAVE__CHMOD)
  130 CHECK_FUNCTION_EXISTS(_close HAVE__CLOSE)
  131 CHECK_FUNCTION_EXISTS(_dup HAVE__DUP)
  132 CHECK_FUNCTION_EXISTS(_fdopen HAVE__FDOPEN)
  133 CHECK_FUNCTION_EXISTS(_fileno HAVE__FILENO)
  134 CHECK_FUNCTION_EXISTS(_open HAVE__OPEN)
  135 CHECK_FUNCTION_EXISTS(_setmode HAVE__SETMODE)
  136 CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
  137 CHECK_FUNCTION_EXISTS(_strdup HAVE__STRDUP)
  138 CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
  139 CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64)
  140 CHECK_FUNCTION_EXISTS(_strtoui64 HAVE__STRTOUI64)
  141 CHECK_FUNCTION_EXISTS(_umask HAVE__UMASK)
  142 CHECK_FUNCTION_EXISTS(_unlink HAVE__UNLINK)
  143 CHECK_FUNCTION_EXISTS(clonefile HAVE_CLONEFILE)
  144 CHECK_FUNCTION_EXISTS(explicit_bzero HAVE_EXPLICIT_BZERO)
  145 CHECK_FUNCTION_EXISTS(explicit_memset HAVE_EXPLICIT_MEMSET)
  146 CHECK_FUNCTION_EXISTS(fileno HAVE_FILENO)
  147 CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO)
  148 CHECK_FUNCTION_EXISTS(ftello HAVE_FTELLO)
  149 CHECK_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME)
  150 CHECK_FUNCTION_EXISTS(open HAVE_OPEN)
  151 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
  152 CHECK_FUNCTION_EXISTS(setmode HAVE_SETMODE)
  153 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
  154 CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
  155 CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
  156 CHECK_FUNCTION_EXISTS(stricmp HAVE_STRICMP)
  157 CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
  158 CHECK_FUNCTION_EXISTS(strtoull HAVE_STRTOULL)
  159 
  160 CHECK_INCLUDE_FILES("sys/types.h;sys/stat.h;fts.h" HAVE_FTS_H)
  161 CHECK_INCLUDE_FILES(stdbool.h HAVE_STDBOOL_H)
  162 CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
  163 CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
  164 
  165 CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H_LIBZIP)
  166 CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H_LIBZIP)
  167 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H_LIBZIP)
  168 
  169 # TODO: fix test
  170 # this test does not find __progname even when it exists
  171 #CHECK_SYMBOL_EXISTS(__progname stdlib.h HAVE___PROGNAME)
  172 
  173 CHECK_TYPE_SIZE(__int8 __INT8_LIBZIP)
  174 CHECK_TYPE_SIZE(int8_t INT8_T_LIBZIP)
  175 CHECK_TYPE_SIZE(uint8_t UINT8_T_LIBZIP)
  176 CHECK_TYPE_SIZE(__int16 __INT16_LIBZIP)
  177 CHECK_TYPE_SIZE(int16_t INT16_T_LIBZIP)
  178 CHECK_TYPE_SIZE(uint16_t UINT16_T_LIBZIP)
  179 CHECK_TYPE_SIZE(__int32 __INT32_LIBZIP)
  180 CHECK_TYPE_SIZE(int32_t INT32_T_LIBZIP)
  181 CHECK_TYPE_SIZE(uint32_t UINT32_T_LIBZIP)
  182 CHECK_TYPE_SIZE(__int64 __INT64_LIBZIP)
  183 CHECK_TYPE_SIZE(int64_t INT64_T_LIBZIP)
  184 CHECK_TYPE_SIZE(uint64_t UINT64_T_LIBZIP)
  185 CHECK_TYPE_SIZE("short" SHORT_LIBZIP)
  186 CHECK_TYPE_SIZE("int" INT_LIBZIP)
  187 CHECK_TYPE_SIZE("long" LONG_LIBZIP)
  188 CHECK_TYPE_SIZE("long long" LONG_LONG_LIBZIP)
  189 CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T)
  190 CHECK_TYPE_SIZE("size_t" SIZE_T_LIBZIP)
  191 CHECK_TYPE_SIZE("ssize_t" SSIZE_T_LIBZIP)
  192 
  193 CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
  194 #include <linux/fs.h>
  195 int main(int argc, char *argv[]) { unsigned long x = FICLONERANGE; }" HAVE_FICLONERANGE)
  196 
  197 CHECK_C_SOURCE_COMPILES("
  198 int foo(char * _Nullable bar);
  199 int main(int argc, char *argv[]) { }" HAVE_NULLABLE)
  200 
  201 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
  202 
  203 FIND_PACKAGE(ZLIB REQUIRED)
  204 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
  205 SET(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
  206 IF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
  207   MESSAGE(FATAL_ERROR "-- ZLIB version too old, please install at least v1.1.2")
  208 ENDIF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
  209 
  210 IF(ENABLE_BZIP2)
  211   FIND_PACKAGE(BZip2)
  212   IF(BZIP2_FOUND)
  213     SET (HAVE_LIBBZ2 1)
  214 
  215     INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
  216     SET (OPTIONAL_LIBRARY ${BZIP2_LIBRARY})
  217   ELSE()
  218     MESSAGE(WARNING "-- bzip2 library not found; bzip2 support disabled")
  219   ENDIF(BZIP2_FOUND)
  220 ENDIF(ENABLE_BZIP2)
  221 
  222 IF (COMMONCRYPTO_FOUND)
  223   SET (HAVE_CRYPTO 1)
  224   SET (HAVE_COMMONCRYPTO 1)
  225 ELSEIF (WINDOWS_CRYPTO_FOUND)
  226   SET (HAVE_CRYPTO 1)
  227   SET (HAVE_WINDOWS_CRYPTO 1)
  228 ELSEIF (GNUTLS_FOUND AND NETTLE_FOUND)
  229   SET (HAVE_CRYPTO 1)
  230   SET (HAVE_GNUTLS 1)
  231   INCLUDE_DIRECTORIES(${GNUTLS_INCLUDE_DIR} ${NETTLE_INCLUDE_DIR})
  232   SET (OPTIONAL_LIBRARY ${OPTIONAL_LIBRARY} ${GNUTLS_LIBRARY} ${NETTLE_LIBRARY})
  233 ELSEIF (OPENSSL_FOUND)
  234   SET (HAVE_CRYPTO 1)
  235   SET (HAVE_OPENSSL 1)
  236   INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
  237   SET (OPTIONAL_LIBRARY ${OPTIONAL_LIBRARY} ${OPENSSL_LIBRARIES})
  238 ELSEIF (MBEDTLS_LIBRARIES)
  239   SET (HAVE_CRYPTO 1)
  240   SET (HAVE_MBEDTLS 1)
  241   INCLUDE_DIRECTORIES(${MBEDTLS_INCLUDE_DIR})
  242   SET (OPTIONAL_LIBRARY ${OPTIONAL_LIBRARY} ${MBEDTLS_LIBRARIES})
  243 ENDIF()
  244 
  245 IF (NOT HAVE_CRYPTO)
  246   MESSAGE(WARNING "-- neither Common Crypto, GnuTLS, mbed TLS, OpenSSL, nor Windows Cryptography found; AES support disabled")
  247 ENDIF()
  248 
  249 IF(MSVC)
  250 ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
  251 ADD_DEFINITIONS("-D_CRT_NONSTDC_NO_DEPRECATE")
  252 ENDIF(MSVC)
  253 
  254 if(WIN32)
  255   if(HAVE_WINDOWS_CRYPTO)
  256     SET (OPTIONAL_LIBRARY "${OPTIONAL_LIBRARY}" bcrypt)
  257   endif()
  258   if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
  259     ADD_DEFINITIONS(-DMS_UWP)
  260   else(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
  261     SET (OPTIONAL_LIBRARY "${OPTIONAL_LIBRARY}" advapi32)
  262   endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
  263 endif(WIN32)
  264 
  265 ADD_DEFINITIONS("-DHAVE_CONFIG_H")
  266 
  267 # rpath handling: use rpath in installed binaries
  268 IF(NOT CMAKE_SYSTEM_NAME MATCHES Linux)
  269 	SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
  270 	SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  271 ENDIF()
  272 
  273 # Testing
  274 ENABLE_TESTING()
  275 
  276 # Targets
  277 ADD_SUBDIRECTORY(lib)
  278 
  279 IF(BUILD_DOC)
  280 ADD_SUBDIRECTORY(man)
  281 ENDIF()
  282 
  283 IF(BUILD_TOOLS)
  284 ADD_SUBDIRECTORY(src)
  285 ENDIF()
  286 
  287 IF(BUILD_REGRESS)
  288 ADD_SUBDIRECTORY(regress)
  289 ENDIF()
  290 
  291 IF(BUILD_EXAMPLES)
  292 ADD_SUBDIRECTORY(examples)
  293 ENDIF()
  294 
  295 
  296 # pkgconfig file
  297 SET(prefix ${CMAKE_INSTALL_PREFIX})
  298 SET(exec_prefix \${prefix})
  299 SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR})
  300 SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
  301 SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
  302 IF(BZIP2_FOUND)
  303   SET(LIBS "${LIBS} -lbz2")
  304 ENDIF()
  305 SET(LIBS "${LIBS} -lz")
  306 IF(CMAKE_SYSTEM_NAME MATCHES BSD)
  307   SET(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
  308 ENDIF(CMAKE_SYSTEM_NAME MATCHES BSD)
  309 CONFIGURE_FILE(libzip.pc.in libzip.pc @ONLY)
  310 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzip.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
  311 
  312 # fixed size integral types
  313 
  314 IF(HAVE_STDINT_H_LIBZIP)
  315   SET(LIBZIP_TYPES_INCLUDE "#include <stdint.h>")
  316 ELSEIF(HAVE_INTTYPES_H_LIBZIP)
  317   SET(LIBZIP_TYPES_INCLUDE "#include <inttypes.h>")
  318 ELSEIF(HAVE_SYS_TYPES_H_LIBZIP)
  319   SET(LIBZIP_TYPES_INCLUDE "#include <sys/types.h>")
  320 ENDIF()
  321 
  322 IF(HAVE_INT8_T_LIBZIP)
  323   SET(ZIP_INT8_T int8_t)
  324 ELSEIF(HAVE___INT8_LIBZIP)
  325   SET(ZIP_INT8_T __int8)
  326 ELSE()
  327   SET(ZIP_INT8_T "signed char")
  328 ENDIF()
  329 
  330 IF(HAVE_UINT8_T_LIBZIP)
  331   SET(ZIP_UINT8_T uint8_t)
  332 ELSEIF(HAVE___INT8_LIBZIP)
  333   SET(ZIP_UINT8_T "unsigned __int8")
  334 ELSE()
  335   SET(ZIP_UINT8_T "unsigned char")
  336 ENDIF()
  337 
  338 IF(HAVE_INT16_T_LIBZIP)
  339   SET(ZIP_INT16_T int16_t)
  340 ELSEIF(HAVE___INT16_LIBZIP)
  341   SET(INT16_T_LIBZIP __int16)
  342 ELSEIF(SHORT_LIBZIP EQUAL 2)
  343   SET(INT16_T_LIBZIP short)
  344 ENDIF()
  345 
  346 IF(HAVE_UINT16_T_LIBZIP)
  347   SET(ZIP_UINT16_T uint16_t)
  348 ELSEIF(HAVE___INT16_LIBZIP)
  349   SET(UINT16_T_LIBZIP "unsigned __int16")
  350 ELSEIF(SHORT_LIBZIP EQUAL 2)
  351   SET(UINT16_T_LIBZIP "unsigned short")
  352 ENDIF()
  353 
  354 IF(HAVE_INT32_T_LIBZIP)
  355   SET(ZIP_INT32_T int32_t)
  356 ELSEIF(HAVE___INT32_LIBZIP)
  357   SET(ZIP_INT32_T __int32)
  358 ELSEIF(INT_LIBZIP EQUAL 4)
  359   SET(ZIP_INT32_T int)
  360 ELSEIF(LONG_LIBZIP EQUAL 4)
  361   SET(ZIP_INT32_T long)
  362 ENDIF()
  363 
  364 IF(HAVE_UINT32_T_LIBZIP)
  365 SET(ZIP_UINT32_T uint32_t)
  366 ELSEIF(HAVE___INT32_LIBZIP)
  367 SET(ZIP_UINT32_T "unsigned __int32")
  368 ELSEIF(INT_LIBZIP EQUAL 4)
  369 SET(ZIP_UINT32_T "unsigned int")
  370 ELSEIF(LONG_LIBZIP EQUAL 4)
  371 SET(ZIP_UINT32_T "unsigned long")
  372 ENDIF()
  373 
  374 IF(HAVE_INT64_T_LIBZIP)
  375   SET(ZIP_INT64_T int64_t)
  376 ELSEIF(HAVE___INT64_LIBZIP)
  377   SET(ZIP_INT64_T __int64)
  378 ELSEIF(LONG_LIBZIP EQUAL 8)
  379   SET(ZIP_INT64_T long)
  380 ELSEIF(LONG_LONG_LIBZIP EQUAL 8)
  381   SET(ZIP_INT64_T "long long")
  382 ENDIF()
  383 
  384 IF(HAVE_UINT64_T_LIBZIP)
  385   SET(ZIP_UINT64_T uint64_t)
  386 ELSEIF(HAVE___INT64_LIBZIP)
  387   SET(ZIP_UINT64_T "unsigned __int64")
  388 ELSEIF(LONG_LIBZIP EQUAL 8)
  389   SET(ZIP_UINT64_T "unsigned long")
  390 ELSEIF(LONG_LONG_LIBZIP EQUAL 8)
  391   SET(ZIP_UINT64_T "unsigned long long")
  392 ENDIF()
  393 
  394 IF(HAVE_NULLABLE)
  395   SET(ZIP_NULLABLE_DEFINES)
  396 ELSE()
  397   SET(ZIP_NULLABLE_DEFINES "#define _Nullable
  398 #define _Nonnull")
  399 ENDIF()
  400 
  401 # write out config file
  402 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
  403 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-zipconf.h.in ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h)
  404 
  405 # for tests
  406 
  407 SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR}/regress)
  408 SET(abs_srcdir ${CMAKE_CURRENT_SOURCE_DIR}/regress)
  409 SET(top_builddir ${CMAKE_BINARY_DIR})
  410 
  411 CONFIGURE_FILE(regress/runtest.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest @ONLY)
  412 FILE(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest
  413   DESTINATION ${CMAKE_BINARY_DIR}/regress
  414   FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
  415 )
  416 
  417 
  418 # installation
  419 
  420 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})