<commit_before>IF(NOT APPLE)
  cmake_minimum_required(VERSION 2.6)
ELSE(NOT APPLE)
  cmake_minimum_required(VERSION 2.8)
ENDIF(NOT APPLE)

find_package(ossim)
find_package(OpenThreads)
find_package(OssimVideo)
find_package(FFmpeg)

# GEOS - Currently optional until it is actually called.:
find_package( GEOS )

if( GEOS_FOUND )
   include_directories( ${GEOS_INCLUDE_DIR} )
else( GEOS_FOUND )
  set(GEOS_LIBRARY "")
  message( FATAL_ERROR "Could not find geos package! Consider installing this as it will soon become a required package." )
endif( GEOS_FOUND )

MESSAGE( STATUS "OSSIM_INCLUDE_DIR=${OSSIM_INCLUDE_DIR}")
MESSAGE( STATUS "OSSIM_LIBRARIES =${OSSIM_LIBRARIES}")
MESSAGE( STATUS "OPENTHREADS_LIBRARY = ${OPENTHREADS_LIBRARY}")
MESSAGE( STATUS "OPENTHREADS_INCLUDE_DIR = ${OPENTHREADS_INCLUDE_DIR}")
MESSAGE( STATUS "OSSIMVIDEO_LIBRARIES   = ${OSSIMVIDEO_LIBRARIES}")
MESSAGE( STATUS "OSSIMVIDEO_INCLUDE_DIR = ${OSSIMVIDEO_INCLUDE_DIR}")
MESSAGE( STATUS "FFMPEG_LIBRARIES = ${FFMPEG_LIBRARIES}")
MESSAGE( STATUS "FFMPEG_INCLUDE_DIRS = ${FFMPEG_INCLUDE_DIRS}")


################################################## BUILD THE C OMS LIBRARY #######################################
SET(LIB_NAME oms)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${OSSIM_INCLUDE_DIR})

SET(VIDEO_LIBRARIES "")
IF(OSSIMVIDEO_FOUND AND BUILD_OSSIM_VIDEO)
MESSAGE("ADDING THE VIDEO DEFINE----------------------------")
    ADD_DEFINITIONS(-DOSSIM_VIDEO_ENABLED=1)
    INCLUDE_DIRECTORIES(${OSSIMVIDEO_INCLUDE_DIR})
    INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
    SET(VIDEO_LIBRARIES ${OSSIMVIDEO_LIBRARY})
ELSE()
    MESSAGE(WARNING "********* VIDEO video support was not found and will not be compiled into the oms library")
ENDIF()

INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR})

FILE(GLOB OMS_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src/oms/*.cpp")
FILE(GLOB OMS_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/oms/*.h")

set(INSTALL_INCLUDE_DIR "include/oms")
OSSIM_LINK_LIBRARY(${LIB_NAME} COMPONENT_NAME ossim TYPE "${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}" HEADERS ${OMS_HEADERS} 
SOURCE_FILES ${OMS_SRCS} 
                   LIBRARIES ${OSSIM_LIBRARY} ${OPENTHREADS_LIBRARY} ${GEOS_LIBRARY} ${VIDEO_LIBRARIES}
                   INSTALL_LIB INSTALL_HEADERS VERSION_SYMLINKS ADDITIONAL_COMPILE_FLAGS "-DOMS_LIBRARY -D__STDC_CONSTANT_MACROS")



##################################### SETUP TEST APPLICATION BUILDS #############################
IF(BUILD_OSSIM_TEST_APPS)
   IF(OSSIMVIDEO_FOUND AND BUILD_OSSIMVIDEO)
       set(TARGET_COMMON_LIBRARIES ossim oms ossimPredator)
   ELSE()
       set(TARGET_COMMON_LIBRARIES ossim oms)
   ENDIF()
    IF(BUILD_OSSIMVIDEO)
       OSSIM_SETUP_APPLICATION(oms-video-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES test/oms-video-test.cpp)
    ENDIF(BUILD_OSSIMVIDEO)
    OSSIM_SETUP_APPLICATION(oms-stage-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES test/oms-stage-test.cpp)
    OSSIM_SETUP_APPLICATION(oms-image-info COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/oms-image-info.cpp)
   
ENDIF(BUILD_OSSIM_TEST_APPS)
set(TARGET_COMMON_LIBRARIES ossim oms)
OSSIM_SETUP_APPLICATION(image-info INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/image-info.cpp)
OSSIM_SETUP_APPLICATION(image-thumbnail INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/image-thumbnail.cpp)

####################################### SETUP THE UNINSTALL #################################
#OSSIM_ADD_COMMON_MAKE_UNINSTALL()<commit_msg>oms is linked with add_dependencies<commit_after>IF(NOT APPLE)
  cmake_minimum_required(VERSION 2.6)
ELSE(NOT APPLE)
  cmake_minimum_required(VERSION 2.8)
ENDIF(NOT APPLE)

find_package(ossim)
find_package(OpenThreads)
find_package(OssimVideo)
find_package(FFmpeg)

# GEOS - Currently optional until it is actually called.:
find_package( GEOS )

if( GEOS_FOUND )
   include_directories( ${GEOS_INCLUDE_DIR} )
else( GEOS_FOUND )
  set(GEOS_LIBRARY "")
  message( FATAL_ERROR "Could not find geos package! Consider installing this as it will soon become a required package." )
endif( GEOS_FOUND )

MESSAGE( STATUS "OSSIM_INCLUDE_DIR=${OSSIM_INCLUDE_DIR}")
MESSAGE( STATUS "OSSIM_LIBRARIES =${OSSIM_LIBRARIES}")
MESSAGE( STATUS "OPENTHREADS_LIBRARY = ${OPENTHREADS_LIBRARY}")
MESSAGE( STATUS "OPENTHREADS_INCLUDE_DIR = ${OPENTHREADS_INCLUDE_DIR}")
MESSAGE( STATUS "OSSIMVIDEO_LIBRARIES   = ${OSSIMVIDEO_LIBRARIES}")
MESSAGE( STATUS "OSSIMVIDEO_INCLUDE_DIR = ${OSSIMVIDEO_INCLUDE_DIR}")
MESSAGE( STATUS "FFMPEG_LIBRARIES = ${FFMPEG_LIBRARIES}")
MESSAGE( STATUS "FFMPEG_INCLUDE_DIRS = ${FFMPEG_INCLUDE_DIRS}")


################################################## BUILD THE C OMS LIBRARY #######################################
SET(LIB_NAME oms)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${OSSIM_INCLUDE_DIR})

SET(VIDEO_LIBRARIES "")
IF(OSSIMVIDEO_FOUND AND BUILD_OSSIM_VIDEO)
MESSAGE("ADDING THE VIDEO DEFINE----------------------------")
    ADD_DEFINITIONS(-DOSSIM_VIDEO_ENABLED=1)
    INCLUDE_DIRECTORIES(${OSSIMVIDEO_INCLUDE_DIR})
    INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
    SET(VIDEO_LIBRARIES ${OSSIMVIDEO_LIBRARY})
ELSE()
    MESSAGE(WARNING "********* VIDEO video support was not found and will not be compiled into the oms library")
ENDIF()

INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR})

FILE(GLOB OMS_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src/oms/*.cpp")
FILE(GLOB OMS_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/oms/*.h")

set(INSTALL_INCLUDE_DIR "include/oms")
OSSIM_LINK_LIBRARY(${LIB_NAME} COMPONENT_NAME ossim TYPE "${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}" HEADERS ${OMS_HEADERS} 
SOURCE_FILES ${OMS_SRCS} 
                   LIBRARIES ${OSSIM_LIBRARY} ${OPENTHREADS_LIBRARY} ${GEOS_LIBRARY} ${VIDEO_LIBRARIES}
                   INSTALL_LIB INSTALL_HEADERS VERSION_SYMLINKS ADDITIONAL_COMPILE_FLAGS "-DOMS_LIBRARY -D__STDC_CONSTANT_MACROS")



##################################### SETUP TEST APPLICATION BUILDS #############################
IF(BUILD_OSSIM_TEST_APPS)
   IF(OSSIMVIDEO_FOUND AND BUILD_OSSIMVIDEO)
       set(TARGET_COMMON_LIBRARIES ossim ossimPredator)
   ELSE()
       set(TARGET_COMMON_LIBRARIES ossim)
   ENDIF()
    IF(BUILD_OSSIMVIDEO)
       OSSIM_SETUP_APPLICATION(oms-video-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES test/oms-video-test.cpp)
    ENDIF(BUILD_OSSIMVIDEO)
    OSSIM_SETUP_APPLICATION(oms-stage-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES test/oms-stage-test.cpp)
    OSSIM_SETUP_APPLICATION(oms-image-info COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/oms-image-info.cpp)
   
ENDIF(BUILD_OSSIM_TEST_APPS)
set(TARGET_COMMON_LIBRARIES ossim)
OSSIM_SETUP_APPLICATION(image-info INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/image-info.cpp)
OSSIM_SETUP_APPLICATION(image-thumbnail INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES apps/image-thumbnail.cpp)

####################################### SETUP THE UNINSTALL #################################
#OSSIM_ADD_COMMON_MAKE_UNINSTALL()
{'fraction_non_alphanumeric': 0.15639943741209564, 'fraction_numerical': 0.0014064697609001407, 'mean_word_length': 6.989887640449438, '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': '4469103', 'n_tokens_mistral': 2774, 'n_tokens_neox': 2480, 'n_words': 424}