<commit_before>project(src)

#set(CMAKE_BUILD_TYPE Debug)
cmake_minimum_required (VERSION 2.6)

# Set the OpenALPR version in cmake, and also add it as a DEFINE for the code to access
SET(OPENALPR_MAJOR_VERSION "2")
SET(OPENALPR_MINOR_VERSION "1")
SET(OPENALPR_PATCH_VERSION "0")
SET(OPENALPR_VERSION ${OPENALPR_MAJOR_VERSION}.${OPENALPR_MINOR_VERSION}.${OPENALPR_PATCH_VERSION})

add_definitions( -DOPENALPR_MAJOR_VERSION=${OPENALPR_MAJOR_VERSION})
add_definitions( -DOPENALPR_MINOR_VERSION=${OPENALPR_MINOR_VERSION})
add_definitions( -DOPENALPR_PATCH_VERSION=${OPENALPR_PATCH_VERSION})

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")

# TODO: switch to http://www.cmake.org/cmake/help/v2.8.5/cmake.html#module:GNUInstallDirs ?
IF (NOT CMAKE_INSTALL_SYSCONFDIR) 
  SET(CMAKE_INSTALL_SYSCONFDIR "/etc")
ENDIF()
IF (NOT CMAKE_INSTALL_VARDIR) 
  SET(CMAKE_INSTALL_VARDIR "${CMAKE_INSTALL_PREFIX}/var")
ENDIF()

IF ( NOT DEFINED WITH_DAEMON )
  SET(WITH_DAEMON ON)
ENDIF()

if ( NOT DEFINED WITH_GPU_DETECTOR )
  SET(WITH_GPU_DETECTOR OFF)
ENDIF()

IF (WIN32 AND WITH_DAEMON) 
  MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.")
  SET(WITH_DAEMON OFF)
ENDIF()

FIND_PACKAGE( Tesseract REQUIRED )

include_directories(${Tesseract_INCLUDE_DIRS})

# Discover OpenCV directory automatically
find_path(OpenCV_DIR
  NAMES OpenCVConfig.cmake
  HINTS ${CMAKE_SOURCE_DIR}/../libraries/opencv/)
		
# Opencv Package
FIND_PACKAGE( OpenCV REQUIRED )
IF (${OpenCV_VERSION} VERSION_LESS 2.4.7)
	MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
ENDIF()
IF (${OpenCV_VERSION} VERSION_GREATER 2.4.12)
	MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
ENDIF()

include_directories(./openalpr )

IF (WIN32)
	add_definitions( -DWINDOWS)
	add_definitions( -DNOMINMAX)

	# Extra linker dependencies for Windows
	SET (Tesseract_LIBRARIES
		${Tesseract_LIBRARIES}
		ws2_32.lib
	)
ELSE()

	SET (Extra_LIBS
		pthread
	)

ENDIF()


set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ")
ADD_EXECUTABLE( alpr  main.cpp )

TARGET_LINK_LIBRARIES(alpr
	openalpr
	support
    video
	${OpenCV_LIBS}
	${Tesseract_LIBRARIES}
    ${Extra_LIBS}
  )

# Compile the alprd library on Unix-based OS
IF (WITH_DAEMON)
  ADD_EXECUTABLE( alprd  daemon.cpp daemon/beanstalk.c daemon/beanstalk.cc )

  TARGET_LINK_LIBRARIES(alprd
	  openalpr
	  support
      video
	  curl
	  log4cplus
	  ${OpenCV_LIBS}
	  ${Tesseract_LIBRARIES}
      ${Extra_LIBS}
    )
	
	# Don't include misc utilities for Windows
	add_subdirectory(misc_utilities)
ENDIF()
  
add_subdirectory(tests)

add_subdirectory(openalpr)
add_subdirectory(video)
<commit_msg>Building tests should be optional.<commit_after>project(src)

#set(CMAKE_BUILD_TYPE Debug)
cmake_minimum_required (VERSION 2.6)

# Set the OpenALPR version in cmake, and also add it as a DEFINE for the code to access
SET(OPENALPR_MAJOR_VERSION "2")
SET(OPENALPR_MINOR_VERSION "1")
SET(OPENALPR_PATCH_VERSION "0")
SET(OPENALPR_VERSION ${OPENALPR_MAJOR_VERSION}.${OPENALPR_MINOR_VERSION}.${OPENALPR_PATCH_VERSION})

add_definitions( -DOPENALPR_MAJOR_VERSION=${OPENALPR_MAJOR_VERSION})
add_definitions( -DOPENALPR_MINOR_VERSION=${OPENALPR_MINOR_VERSION})
add_definitions( -DOPENALPR_PATCH_VERSION=${OPENALPR_PATCH_VERSION})

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")

# TODO: switch to http://www.cmake.org/cmake/help/v2.8.5/cmake.html#module:GNUInstallDirs ?
IF (NOT CMAKE_INSTALL_SYSCONFDIR) 
  SET(CMAKE_INSTALL_SYSCONFDIR "/etc")
ENDIF()
IF (NOT CMAKE_INSTALL_VARDIR) 
  SET(CMAKE_INSTALL_VARDIR "${CMAKE_INSTALL_PREFIX}/var")
ENDIF()

IF ( NOT DEFINED WITH_DAEMON )
  SET(WITH_DAEMON ON)
ENDIF()

if ( NOT DEFINED WITH_GPU_DETECTOR )
  SET(WITH_GPU_DETECTOR OFF)
ENDIF()

if ( NOT DEFINED WITH_TESTS )
  SET(WITH_TESTS ON)
ENDIF()

IF (WIN32 AND WITH_DAEMON) 
  MESSAGE(WARNING "Skipping alprd daemon installation, as it is not supported in Windows.")
  SET(WITH_DAEMON OFF)
ENDIF()

FIND_PACKAGE( Tesseract REQUIRED )

include_directories(${Tesseract_INCLUDE_DIRS})

# Discover OpenCV directory automatically
find_path(OpenCV_DIR
  NAMES OpenCVConfig.cmake
  HINTS ${CMAKE_SOURCE_DIR}/../libraries/opencv/)
		
# Opencv Package
FIND_PACKAGE( OpenCV REQUIRED )
IF (${OpenCV_VERSION} VERSION_LESS 2.4.7)
	MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
ENDIF()
IF (${OpenCV_VERSION} VERSION_GREATER 2.4.12)
	MESSAGE(FATAL_ERROR "OpenCV version is not compatible : ${OpenCV_VERSION}")
ENDIF()

include_directories(./openalpr )

IF (WIN32)
	add_definitions( -DWINDOWS)
	add_definitions( -DNOMINMAX)

	# Extra linker dependencies for Windows
	SET (Tesseract_LIBRARIES
		${Tesseract_LIBRARIES}
		ws2_32.lib
	)
ELSE()

	SET (Extra_LIBS
		pthread
	)

ENDIF()


set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ")
ADD_EXECUTABLE( alpr  main.cpp )

TARGET_LINK_LIBRARIES(alpr
	openalpr
	support
    video
	${OpenCV_LIBS}
	${Tesseract_LIBRARIES}
    ${Extra_LIBS}
  )

# Compile the alprd library on Unix-based OS
IF (WITH_DAEMON)
  ADD_EXECUTABLE( alprd  daemon.cpp daemon/beanstalk.c daemon/beanstalk.cc )

  TARGET_LINK_LIBRARIES(alprd
	  openalpr
	  support
      video
	  curl
	  log4cplus
	  ${OpenCV_LIBS}
	  ${Tesseract_LIBRARIES}
      ${Extra_LIBS}
    )
	
	# Don't include misc utilities for Windows
	add_subdirectory(misc_utilities)
ENDIF()

if (WITH_TESTS)  
add_subdirectory(tests)
ENDIF()

add_subdirectory(openalpr)
add_subdirectory(video)

{'fraction_non_alphanumeric': 0.09932812783729798, 'fraction_numerical': 0.00835300526602506, 'mean_word_length': 5.8936170212765955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5587273', 'n_tokens_mistral': 2299, 'n_tokens_neox': 2163, 'n_words': 412}