<commit_before>project(sqlatelib)

cmake_minimum_required(VERSION 3.2.0)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

option(SQL_ENABLE_NETWORK_WATCHER "Enable the watcher threads for SQL queries over the network. The default is disabled." FALSE)

if (SQL_ENABLE_NETWORK_WATCHER)
  add_definitions(-DSQL_ENABLE_NETWORK_WATCHER)
endif ()

find_package(Qt5Core 5.4 REQUIRED)
find_package(Qt5Sql 5.4 REQUIRED)
find_package(Qt5Widgets 5.4 REQUIRED)
find_package(Qt5Test 5.4 REQUIRED)

find_package(Boost 1.40 REQUIRED)

#the user of the library might have defined a larger size
set(MPL_LIMIT_DEFINED "FALSE")
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
foreach(define ${DirDefs})
  if (${define} MATCHES "BOOST_MPL_LIMIT_VECTOR_SIZE=.*")
    set(MPL_LIMIT_DEFINED "TRUE")
  endif()
endforeach()
if (NOT ${MPL_LIMIT_DEFINED})
  add_definitions( -DBOOST_MPL_LIMIT_VECTOR_SIZE=50)
endif()

add_definitions( -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS )
add_definitions( -DQT_STRICT_ITERATORS )
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
add_definitions( -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions( -fPIC )
add_definitions(-std=c++14)

enable_testing()

set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (eg. '64')")

set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
set(PLUGIN_INSTALL_DIR plugins)
set(BIN_INSTALL_DIR bin)
set(INCLUDE_INSTALL_DIR include)

include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS})

add_custom_target(headers SOURCES
  Sql.h
  SqlCreateRule.h
  SqlExceptions.h
  SqlGlobal.h
  SqlGrantPermission.h
  SqlGraphviz.h
  SqlSelect.h
)

set(SQLATE_SRCS
  kdthreadrunner.cpp
  PostgresSchema.cpp
  SqlCondition.cpp
  SqlConditionalQueryBuilderBase.cpp
  SqlCreateTable.cpp
  SqlDeleteQueryBuilder.cpp
  SqlInsertQueryBuilder.cpp
  SqlMonitor.cpp
  SqlQuery.cpp
  SqlQueryBuilderBase.cpp
  SqlQueryCache.cpp
  SqlQueryManager.cpp
  SqlQueryWatcher.cpp
  SqlSchema.cpp
  SqlSelectQueryBuilder.cpp
  SqlTransaction.cpp
  SqlUpdateQueryBuilder.cpp
  SqlUtils.cpp
)

install(FILES
  PostgresSchema.h
  SchemaUpdater.h<commit_msg>Add SqlInsert.h to the project<commit_after>project(sqlatelib)

cmake_minimum_required(VERSION 3.2.0)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

option(SQL_ENABLE_NETWORK_WATCHER "Enable the watcher threads for SQL queries over the network. The default is disabled." FALSE)

if (SQL_ENABLE_NETWORK_WATCHER)
  add_definitions(-DSQL_ENABLE_NETWORK_WATCHER)
endif ()

find_package(Qt5Core 5.4 REQUIRED)
find_package(Qt5Sql 5.4 REQUIRED)
find_package(Qt5Widgets 5.4 REQUIRED)
find_package(Qt5Test 5.4 REQUIRED)

find_package(Boost 1.40 REQUIRED)

#the user of the library might have defined a larger size
set(MPL_LIMIT_DEFINED "FALSE")
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
foreach(define ${DirDefs})
  if (${define} MATCHES "BOOST_MPL_LIMIT_VECTOR_SIZE=.*")
    set(MPL_LIMIT_DEFINED "TRUE")
  endif()
endforeach()
if (NOT ${MPL_LIMIT_DEFINED})
  add_definitions( -DBOOST_MPL_LIMIT_VECTOR_SIZE=50)
endif()

add_definitions( -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS )
add_definitions( -DQT_STRICT_ITERATORS )
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
add_definitions( -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions( -fPIC )
add_definitions(-std=c++14)

enable_testing()

set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (eg. '64')")

set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
set(PLUGIN_INSTALL_DIR plugins)
set(BIN_INSTALL_DIR bin)
set(INCLUDE_INSTALL_DIR include)

include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS})

add_custom_target(headers SOURCES
  Sql.h
  SqlCreateRule.h
  SqlExceptions.h
  SqlGlobal.h
  SqlGrantPermission.h
  SqlGraphviz.h
  SqlInsert.h
  SqlSelect.h
)

set(SQLATE_SRCS
  kdthreadrunner.cpp
  PostgresSchema.cpp
  SqlCondition.cpp
  SqlConditionalQueryBuilderBase.cpp
  SqlCreateTable.cpp
  SqlDeleteQueryBuilder.cpp
  SqlInsertQueryBuilder.cpp
  SqlMonitor.cpp
  SqlQuery.cpp
  SqlQueryBuilderBase.cpp
  SqlQueryCache.cpp
  SqlQueryManager.cpp
  SqlQueryWatcher.cpp
  SqlSchema.cpp
  SqlSelectQueryBuilder.cpp
  SqlTransaction.cpp
  SqlUpdateQueryBuilder.cpp
  SqlUtils.cpp
)

install(FILES
  PostgresSchema.h
  SchemaUpdater.h
{'fraction_non_alphanumeric': 0.07933461292386436, 'fraction_numerical': 0.011942844956280656, 'mean_word_length': 6.976190476190476, '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': '4388736', 'n_tokens_mistral': 1890, 'n_tokens_neox': 1775, 'n_words': 302}