Blame cmake/generateConfigFile.cmake

Packit Service 21b5d1
include(CheckIncludeFileCXX)
Packit Service 21b5d1
include(CheckCXXSourceCompiles)
Packit Service 21b5d1
include(CheckCXXSymbolExists)
Packit Service 21b5d1
Packit Service 21b5d1
# Note that the scope of the EXV_ variables in local
Packit Service 21b5d1
if (${EXIV2_ENABLE_WEBREADY})
Packit Service 21b5d1
    set(EXV_USE_SSH   ${EXIV2_ENABLE_SSH})
Packit Service 21b5d1
    set(EXV_USE_CURL  ${EXIV2_ENABLE_CURL})
Packit Service 21b5d1
endif()
Packit Service 21b5d1
set(EXV_ENABLE_VIDEO     ${EXIV2_ENABLE_VIDEO})
Packit Service 21b5d1
set(EXV_ENABLE_WEBREADY  ${EXIV2_ENABLE_WEBREADY})
Packit Service 21b5d1
set(EXV_HAVE_LENSDATA    ${EXIV2_ENABLE_LENSDATA})
Packit Service 21b5d1
set(EXV_HAVE_PRINTUCS2   ${EXIV2_ENABLE_PRINTUCS2})
Packit Service 21b5d1
Packit Service 21b5d1
set(EXV_PACKAGE_NAME     ${PROJECT_NAME})
Packit Service 21b5d1
set(EXV_PACKAGE_VERSION  ${PROJECT_VERSION})
Packit Service 21b5d1
set(EXV_PACKAGE_STRING   "${PROJECT_NAME} ${PROJECT_VERSION}")
Packit Service 21b5d1
if (${EXIV2_ENABLE_XMP} OR ${EXIV2_ENABLE_EXTERNAL_XMP})
Packit Service 21b5d1
    set(EXV_HAVE_XMP_TOOLKIT ON)
Packit Service 21b5d1
else()
Packit Service 21b5d1
    set(EXV_HAVE_XMP_TOOLKIT OFF)
Packit Service 21b5d1
endif()
Packit Service 21b5d1
set(EXV_HAVE_ICONV       ${ICONV_FOUND})
Packit Service 21b5d1
set(EXV_HAVE_LIBZ        ${ZLIB_FOUND})
Packit Service 21b5d1
set(EXV_UNICODE_PATH     ${EXIV2_ENABLE_WIN_UNICODE})
Packit Service 21b5d1
Packit Service 21b5d1
check_cxx_symbol_exists(gmtime_r    time.h         EXV_HAVE_GMTIME_R)
Packit Service 21b5d1
check_cxx_symbol_exists(mmap        sys/mman.h     EXV_HAVE_MMAP )
Packit Service 21b5d1
check_cxx_symbol_exists(munmap      sys/mman.h     EXV_HAVE_MUNMAP )
Packit Service 21b5d1
check_cxx_symbol_exists(strerror_r  string.h       EXV_HAVE_STRERROR_R )
Packit Service 21b5d1
Packit Service 21b5d1
check_cxx_source_compiles( "
Packit Service 21b5d1
#include <string.h>
Packit Service 21b5d1
int main() {
Packit Service 21b5d1
    char buff[100];
Packit Service 21b5d1
    const char* c = strerror_r(0,buff,100);
Packit Service 21b5d1
    return 0;
Packit Service 21b5d1
}" EXV_STRERROR_R_CHAR_P )
Packit Service 21b5d1
Packit Service 21b5d1
check_include_file_cxx( "memory.h"      EXV_HAVE_MEMORY_H )
Packit Service 21b5d1
check_include_file_cxx( "process.h"     EXV_HAVE_PROCESS_H )
Packit Service 21b5d1
check_include_file_cxx( "stdbool.h"     EXV_HAVE_STDBOOL_H )
Packit Service 21b5d1
check_include_file_cxx( "stdint.h"      EXV_HAVE_STDINT_H )
Packit Service 21b5d1
check_include_file_cxx( "strings.h"     EXV_HAVE_STRINGS_H )
Packit Service 21b5d1
check_include_file_cxx( "sys/stat.h"    EXV_HAVE_SYS_STAT_H )
Packit Service 21b5d1
check_include_file_cxx( "sys/types.h"   EXV_HAVE_SYS_TYPES_H )
Packit Service 21b5d1
check_include_file_cxx( "inttypes.h"    EXV_HAVE_INTTYPES_H )
Packit Service 21b5d1
check_include_file_cxx( "unistd.h"      EXV_HAVE_UNISTD_H )
Packit Service 21b5d1
check_include_file_cxx( "sys/mman.h"    EXV_HAVE_SYS_MMAN_H )
Packit Service 21b5d1
if ( NOT MINGW AND NOT MSYS AND NOT MSVC )
Packit Service 21b5d1
check_include_file_cxx( "regex.h"       EXV_HAVE_REGEX_H )
Packit Service 21b5d1
endif()
Packit Service 21b5d1
Packit Service 21b5d1
set(EXV_ENABLE_NLS ${EXIV2_ENABLE_NLS})
Packit Service 21b5d1
Packit Service 21b5d1
configure_file(cmake/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY)