<commit_before>CMAKE_MINIMUM_REQUIRED (VERSION 3.0.0 FATAL_ERROR)
IF (NOT MYPACKAGEBOOTSTRAP_DONE)
  INCLUDE ("../../../3rdparty/github/cmake-utils/cmake/MyPackageBootstrap.cmake")
ENDIF ()
# marpaESLIFJava version is synced with marpaESLIF
MYPACKAGESTART (marpaESLIFJava ${marpaESLIF_VERSION_MAJOR} ${marpaESLIF_VERSION_MINOR} ${marpaESLIF_VERSION_PATCH})

INCLUDE (UseJava)
INCLUDE_DIRECTORIES (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})

#
# This is to setup a hook trying to shut down gcc (at least) warning when
# doing: char *x; jlong l = (jlong) x
#
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
IF (HAVE_STDINT_H)
  ADD_DEFINITIONS(-DHAVE_STDINT_H)
ENDIF ()
INCLUDE(CheckTypeSize)
CHECK_TYPE_SIZE(intptr_t INTPTR_T)
IF (HAVE_INTPTR_T)
  MESSAGE(STATUS "Using intptr_t for casting a pointer to jlong")
  ADD_DEFINITIONS(-DHAVE_INTPTR_T)
ENDIF ()

# ------------------------------------------
# JNI
# ------------------------------------------
FILE (GLOB lib_src_java marpaESLIFJava.c)
ADD_LIBRARY (marpaESLIFJava SHARED ${lib_src_java})
TARGET_LINK_LIBRARIES (marpaESLIFJava marpaESLIF ${GENERICLOGGER_LIBRARIES})
SET_TARGET_PROPERTIES (marpaESLIFJava
  PROPERTIES
  VERSION "${${PROJECT_NAME}_VERSION}"
  SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}")
TARGET_COMPILE_DEFINITIONS(marpaESLIFJava
      PRIVATE -DMARPAESLIFJAVA_VERSION_MAJOR=${${PROJECT_NAME}_VERSION_MAJOR}
      PRIVATE -DMARPAESLIFJAVA_VERSION_MINOR=${${PROJECT_NAME}_VERSION_MINOR}
      PRIVATE -DMARPAESLIFJAVA_VERSION_PATCH=${${PROJECT_NAME}_VERSION_PATCH}
      PRIVATE -DMARPAESLIFJAVA_VERSION="${${PROJECT_NAME}_VERSION}"
      )
INSTALL (TARGETS marpaESLIFJava ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT libraries)

# ------------------------------------------
# JAVA
# ------------------------------------------
FILE (GLOB_RECURSE MARPAESLIFJAVA_SRC src "*.java")
SET (CMAKE_JNI_TARGET TRUE)
SET (CMAKE_JAVA_TARGET_VERSION 1.4.0)
# Fix for cmake 3.2, preventing "target marpaESLIFJava_jar is not known in this scope" message
SET (CMAKE_JAVA_TARGET_OUTPUT_NAME marpaESLIF)
ADD_JAR(marpaESLIFJava_jar
        SOURCES ${MARPAESLIFJAVA_SRC}
        VERSION ${${PROJECT_NAME}_VERSION}
        OUTPUT_NAME marpaESLIF
        )
ADD_DEPENDENCIES(marpaESLIFJava_jar marpaESLIFJava)
INSTALL_JAR(marpaESLIFJava_jar share/java)
INSTALL_JNI_SYMLINK(marpaESLIFJava_jar share/java)

# ------------------------------------------
# DOCUMENTATION
# ------------------------------------------
CREATE_JAVADOC(marpaESLIF<commit_msg>java/CMakeLists.txt: Fix genericStack dependency [ci skip]<commit_after>CMAKE_MINIMUM_REQUIRED (VERSION 3.0.0 FATAL_ERROR)
IF (NOT MYPACKAGEBOOTSTRAP_DONE)
  INCLUDE ("../../../3rdparty/github/cmake-utils/cmake/MyPackageBootstrap.cmake")
ENDIF ()
# marpaESLIFJava version is synced with marpaESLIF
MYPACKAGESTART (marpaESLIFJava ${marpaESLIF_VERSION_MAJOR} ${marpaESLIF_VERSION_MINOR} ${marpaESLIF_VERSION_PATCH})

INCLUDE (UseJava)
INCLUDE_DIRECTORIES (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})

#
# This is to setup a hook trying to shut down gcc (at least) warning when
# doing: char *x; jlong l = (jlong) x
#
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
IF (HAVE_STDINT_H)
  ADD_DEFINITIONS(-DHAVE_STDINT_H)
ENDIF ()
INCLUDE(CheckTypeSize)
CHECK_TYPE_SIZE(intptr_t INTPTR_T)
IF (HAVE_INTPTR_T)
  MESSAGE(STATUS "Using intptr_t for casting a pointer to jlong")
  ADD_DEFINITIONS(-DHAVE_INTPTR_T)
ENDIF ()

# ------------------------------------------
# JNI
# ------------------------------------------
FILE (GLOB lib_src_java marpaESLIFJava.c)
ADD_LIBRARY (marpaESLIFJava SHARED ${lib_src_java})
TARGET_LINK_LIBRARIES (marpaESLIFJava marpaESLIF ${GENERICLOGGER_LIBRARIES})
SET_TARGET_PROPERTIES (marpaESLIFJava
  PROPERTIES
  VERSION "${${PROJECT_NAME}_VERSION}"
  SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}")
TARGET_COMPILE_DEFINITIONS(marpaESLIFJava
      PRIVATE -DMARPAESLIFJAVA_VERSION_MAJOR=${${PROJECT_NAME}_VERSION_MAJOR}
      PRIVATE -DMARPAESLIFJAVA_VERSION_MINOR=${${PROJECT_NAME}_VERSION_MINOR}
      PRIVATE -DMARPAESLIFJAVA_VERSION_PATCH=${${PROJECT_NAME}_VERSION_PATCH}
      PRIVATE -DMARPAESLIFJAVA_VERSION="${${PROJECT_NAME}_VERSION}"
      )
INSTALL (TARGETS marpaESLIFJava ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT libraries)

################
# Dependencies #
################
MYPACKAGEDEPENDENCY (genericStack  "${CMAKE_CURRENT_SOURCE_DIR}/../../../3rdparty/github/genericStack"  LIBS LOCAL STATIC)

# ------------------------------------------
# JAVA
# ------------------------------------------
FILE (GLOB_RECURSE MARPAESLIFJAVA_SRC src "*.java")
SET (CMAKE_JNI_TARGET TRUE)
SET (CMAKE_JAVA_TARGET_VERSION 1.4.0)
# Fix for cmake 3.2, preventing "target marpaESLIFJava_jar is not known in this scope" message
SET (CMAKE_JAVA_TARGET_OUTPUT_NAME marpaESLIF)
ADD_JAR(marpaESLIFJava_jar
        SOURCES ${MARPAESLIFJAVA_SRC}
        VERSION ${${PROJECT_NAME}_VERSION}
        OUTPUT_NAME marpaESLIF
        )
ADD_DEPENDENCIES(marpaESLIFJava_jar marpaESLIFJava)
INSTALL_JAR(marpaESLIFJava_jar share/java)
INSTALL_JNI_SYMLINK(marpaESLIFJava_jar share/java)

# ------------------------------------------
# DOCUMENTATION
# ------------------------------------------
CREATE_JAVADOC(marpaESLIF
{'fraction_non_alphanumeric': 0.1839640314724616, 'fraction_numerical': 0.003934057699512926, 'mean_word_length': 3.724778761061947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '950660', 'n_tokens_mistral': 2022, 'n_tokens_neox': 1890, 'n_words': 327}