SET (MARPAESLIF_VERSION_MAJOR 1)
SET (MARPAESLIF_VERSION_MINOR 0)
SET (MARPAESLIF_VERSION_PATCH 2)
SET (MARPAESLIF_VERSION "${MARPAESLIF_VERSION_MAJOR}.${MARPAESLIF_VERSION_MINOR}.${MARPAESLIF_VERSION_PATCH}")

# --------------------
# CFLAGS customization
# --------------------
if (("${CMAKE_C_COMPILER_ID} x" MATCHES "MSVC") OR MSVC)
  # Loosely based on http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/config/cmake/ConfigureChecks.cmake
  ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
  ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
  ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
ENDIF ()
IF (NOT CMAKE_BUILD_TYPE MATCHES Debug)
  ADD_DEFINITIONS(-DMARPAESLIF_NTRACE)
ENDIF (NOT CMAKE_BUILD_TYPE MATCHES Debug)
ADD_DEFINITIONS(-DMARPAESLIF_VERSION="${MARPAESLIF_VERSION}")

# --------------
# Buffering size
# --------------
IF (NOT MARPAESLIF_BUFSIZ)
  SET (MARPAESLIF_BUFSIZ "1048576" CACHE STRING "Buffering size")
  MARK_AS_ADVANCED (MARPAESLIF_BUFSIZ)
ENDIF ()
ADD_DEFINITIONS(-DMARPAESLIF_BUFSIZ=${MARPAESLIF_BUFSIZ})
# In any case, we want to use only the 8 bits version, that is always compiled everywhere AFAIK
ADD_DEFINITIONS(-DPCRE2_CODE_UNIT_WIDTH=8)

MESSAGE(STATUS "")
MESSAGE(STATUS "Compiler Setup:")
MESSAGE(STATUS "---------------")
GET_DIRECTORY_PROPERTY (DirDefs COMPILE_DEFINITIONS)
FOREACH (d ${DirDefs})
    MESSAGE(STATUS "         Definition: ${d}")
ENDFOREACH()
