<commit_before>IF(JPEG_FOUND)
  ADD_DEFINITIONS(-DHasJPEG)
  INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
ENDIF(JPEG_FOUND)

IF(PNG_FOUND)
  ADD_DEFINITIONS(-DHasPNG)
  INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
ENDIF(PNG_FOUND)

IF(TIFF_FOUND)
  ADD_DEFINITIONS(-DHasTIFF)
  INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
ENDIF(TIFF_FOUND)

IF(OPENEXR_FOUND)
  ADD_DEFINITIONS(-DHasEXR)
  INCLUDE_DIRECTORIES(${OPENEXR_INCLUDE_DIR})
ENDIF(OPENEXR_FOUND)

IF(HDF5_FOUND)
  ADD_DEFINITIONS(-DHasHDF5 ${HDF5_CPPFLAGS})
  INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIR})
ENDIF(HDF5_FOUND)

IF (MSVC OR MINGW)
    IF(NOT VIGRA_STATIC_LIB)
        ADD_DEFINITIONS(-DVIGRA_DLL)
    ENDIF()
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
    IF(VIGRA_STATIC_LIB)
        ADD_DEFINITIONS(-fPIC -DPIC)
    ENDIF()
ENDIF ()

ADD_LIBRARY(vigraimpex ${LIBTYPE}
    bmp.cxx
    byteorder.cxx
    codecmanager.cxx
    exr.cxx
    gif.cxx
    hdr.cxx
    hdf5impex.cxx
    hdf5_rf_impex.cxx
    iccjpeg.c
    imageinfo.cxx
    jpeg.cxx
    png.cxx
    pnm.cxx
    rgbe.c
    sifImport.cxx
    sun.cxx
    tiff.cxx
    viff.cxx
    void_vector.cxx)

STRING(REGEX REPLACE "\\." "" LIBRARY_VERSION_STRING ${vigra_version})
set(SOVERSION 5)  # increment this after changing the vigraimpex library
IF(MACOSX)
    SET_TARGET_PROPERTIES(vigraimpex PROPERTIES VERSION ${SOVERSION}.${LIBRARY_VERSION_STRING} 
                         SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
ELSE()
    SET_TARGET_PROPERTIES(vigraimpex PROPERTIES VERSION ${SOVERSION}.${LIBRARY_VERSION_STRING} SOVERSION ${SOVERSION})
ENDIF() 

IF(JPEG_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${JPEG_LIBRARIES})
ENDIF(JPEG_FOUND)

IF(PNG_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${PNG_LIBRARIES})
ENDIF(PNG_FOUND)

IF(TIFF_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${TIFF_LIBRARIES})
ENDIF(TIFF_FOUND)

IF(OPENEXR_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${OPENEXR_LIBRARIES})
ENDIF(OPENEXR_FOUND)

IF(HDF5_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${HDF5_LIBRARIES})
ENDIF(HDF5_FOUND)

INSTALL(TARGETS vigraimpex
        EXPORT vigra-targets
        RUNTIME DESTINATION bin 
        LIBRARY DESTINATION lib${LIB_SUFFIX} <commit_msg>changed shared library version format (patch by <NAME>)<commit_after>IF(JPEG_FOUND)
  ADD_DEFINITIONS(-DHasJPEG)
  INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
ENDIF(JPEG_FOUND)

IF(PNG_FOUND)
  ADD_DEFINITIONS(-DHasPNG)
  INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
ENDIF(PNG_FOUND)

IF(TIFF_FOUND)
  ADD_DEFINITIONS(-DHasTIFF)
  INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
ENDIF(TIFF_FOUND)

IF(OPENEXR_FOUND)
  ADD_DEFINITIONS(-DHasEXR)
  INCLUDE_DIRECTORIES(${OPENEXR_INCLUDE_DIR})
ENDIF(OPENEXR_FOUND)

IF(HDF5_FOUND)
  ADD_DEFINITIONS(-DHasHDF5 ${HDF5_CPPFLAGS})
  INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIR})
ENDIF(HDF5_FOUND)

IF (MSVC OR MINGW)
    IF(NOT VIGRA_STATIC_LIB)
        ADD_DEFINITIONS(-DVIGRA_DLL)
    ENDIF()
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
    IF(VIGRA_STATIC_LIB)
        ADD_DEFINITIONS(-fPIC -DPIC)
    ENDIF()
ENDIF ()

ADD_LIBRARY(vigraimpex ${LIBTYPE}
    bmp.cxx
    byteorder.cxx
    codecmanager.cxx
    exr.cxx
    gif.cxx
    hdr.cxx
    hdf5impex.cxx
    hdf5_rf_impex.cxx
    iccjpeg.c
    imageinfo.cxx
    jpeg.cxx
    png.cxx
    pnm.cxx
    rgbe.c
    sifImport.cxx
    sun.cxx
    tiff.cxx
    viff.cxx
    void_vector.cxx)

STRING(REGEX REPLACE "\\." "" LIBRARY_VERSION_STRING ${vigra_version})
set(SOVERSION 5)  # increment this after changing the vigraimpex library
IF(MACOSX)
    SET_TARGET_PROPERTIES(vigraimpex PROPERTIES VERSION ${SOVERSION}.${vigra_version} 
                         SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
ELSE()
    SET_TARGET_PROPERTIES(vigraimpex PROPERTIES VERSION ${SOVERSION}.${vigra_version} SOVERSION ${SOVERSION})
ENDIF() 

IF(JPEG_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${JPEG_LIBRARIES})
ENDIF(JPEG_FOUND)

IF(PNG_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${PNG_LIBRARIES})
ENDIF(PNG_FOUND)

IF(TIFF_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${TIFF_LIBRARIES})
ENDIF(TIFF_FOUND)

IF(OPENEXR_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${OPENEXR_LIBRARIES})
ENDIF(OPENEXR_FOUND)

IF(HDF5_FOUND)
  TARGET_LINK_LIBRARIES(vigraimpex ${HDF5_LIBRARIES})
ENDIF(HDF5_FOUND)

INSTALL(TARGETS vigraimpex
        EXPORT vigra-targets
        RUNTIME DESTINATION bin 
        LIBRARY DESTINATION lib${LIB_SUFFIX} 
{'fraction_non_alphanumeric': 0.098681218735789, 'fraction_numerical': 0.0050022737608003635, 'mean_word_length': 4.944594594594594, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518561', 'n_tokens_mistral': 2086, 'n_tokens_neox': 1923, 'n_words': 239}